<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type" /><style><!--/*paged media */ div.header {display: none }div.footer {display: none } /*@media print { */@page { size: A4; margin: 10%; @top-center {content: element(header) } @bottom-center {content: element(footer) } }/*element styles*/ .del  {text-decoration:line-through;color:red;} .ins {text-decoration:none;background:#c0ffc0;padding:1px;}
 /* TABLE STYLES */ 
table.TableNormal {display:table;position: relative; margin-left: 0in;}
table.TableGrid {display:table;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;margin-bottom: 0in;line-height: 100%;}

 /* PARAGRAPH STYLES */ 
.DocDefaults {display:block;margin-bottom: 4mm;line-height: 115%;font-size: 11.0pt;}
.Normal {display:block;}
.NormalWeb {display:block;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;font-size: 12.0pt;}
.Command {display:block;position: relative; margin-left: 0.5in;font-size: 10.0pt;}
.FootnoteText {display:block;margin-bottom: 0in;line-height: 100%;font-size: 10.0pt;}
.Title {display:block;border-bottom-style: solid;border-bottom-width: 0.35mm;border-bottom-color: #4F81BD;margin-bottom: 0.21in;line-height: 100%;color: #17365D;font-size: 26.0pt;}
.Grammar {display:block;position: relative; margin-left: 0.75in;text-indent: -0.25in;margin-bottom: 0.08in;line-height: 104%;font-style: italic;}
.TOC2 {display:block;position: relative; margin-left: 4mm;margin-bottom: 0.07in;}
.Heading1 {display:block;page-break-after: avoid;margin-top: 0.33in;margin-bottom: 4mm;font-weight: bold;color: #365F91;font-size: 18.0pt;}
.TOCHeading {display:block;margin-bottom: 0in;font-size: 14.0pt;}
.TOC1 {display:block;margin-bottom: 0.07in;}
.Heading2 {display:block;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;font-weight: bold;font-style: italic;font-size: 14.0pt;}
.Header {display:block;margin-bottom: 0in;line-height: 100%;}
.ListParagraph {display:block;position: relative; margin-left: 0.5in;}
.Footer {display:block;margin-bottom: 0in;line-height: 100%;}
.Normal-TableGrid-BR {display:block;margin-bottom: 0in;line-height: 100%;font-size: 11.0pt;}
.ListParagraph-TableGrid-BR {display:block;position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;font-size: 11.0pt;}

 /* CHARACTER STYLES */ span.DefaultParagraphFont {display:inline;}
span.xmlmarkuptagname {display:inline;}
span.underline {display:inline;}
span.xmlmarkupattributename {display:inline;}
span.apple-style-span {display:inline;}
span.Strong {display:inline;font-weight: bold;}
span.Emphasis {display:inline;font-style: italic;}
span.FootnoteReference {display:inline;vertical-align: super;font-size: smaller;}
span.apple-converted-space {display:inline;}
span.HTMLCode {display:inline;font-size: 10.0pt;}
span.xmlmarkupbracket {display:inline;}
span.xmlmarkupattributevalue {display:inline;}
span.Hyperlink {display:inline;color: #0000FF;text-decoration: underline;}
span.Terminal {display:inline;font-style: italic;font-size: 10.0pt;}
html, body, div, span, h1, h2, h3, h4, h5, h6, p, a, img,  table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0;}body {line-height: 1;} --></style><script type="text/javascript"><!--function toggleDiv(divid){if(document.getElementById(divid).style.display == 'none'){document.getElementById(divid).style.display = 'block';}else{document.getElementById(divid).style.display = 'none';}}
--></script></head><body>
  
  <!-- userBodyTop goes here -->
  
  
  
  <div class="document">
  
  <p class="Title Normal DocDefaults "><span class="" style="font-family: 'Liberation Serif';">Docx4j - Getting Started</span></p>
  
  <p class="TOCHeading Heading1 Normal DocDefaults "><span class="" style="font-family: 'Liberation Serif';">Contents</span></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997707"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">What is docx4j?</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997707"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997708"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">What sorts of things can you do with docx4j?</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997708"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997709"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Is docx4j for you?</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997709"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997710"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">GraalVM</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997710"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997711"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">docx4j.NET</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997711"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997712"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">What Word documents does it support?</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997712"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997713"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Handling legacy binary .doc files</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997713"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997714"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Getting Help: the docx4j forum</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997714"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997715"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">A word about Jaxb</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997715"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997716"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Using docx4j via Maven</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997716"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997717"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Using docx4j binaries</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997717"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997718"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">docx4j dependencies</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997718"><span>1</span></a></a></p>
  
  <p class="TOC2 Normal DocDefaults "><a href="#_Toc41997719"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">slf4j</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997719"><span>1</span></a></a></p>
  
  <p class="TOC2 Normal DocDefaults "><a href="#_Toc41997720"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">other dependencies</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997720"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997721"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Docx4j source code</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997721"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997722"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Javadoc</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997722"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997723"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Building docx4j from source</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997723"><span>1</span></a></a></p>
  
  <p class="TOC2 Normal DocDefaults "><a href="#_Toc41997724"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Command line -via Maven</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997724"><span>1</span></a></a></p>
  
  <p class="TOC2 Normal DocDefaults "><a href="#_Toc41997725"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Eclipse</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997725"><span>1</span></a></a></p>
  
  <p class="TOC2 Normal DocDefaults "><a href="#_Toc41997726"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Using a different IDE?</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997726"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997727"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Open an existing docx/pptx/xlsx document</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997727"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997728"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">OpenXML concepts</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997728"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997729"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Specification versions</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997729"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997730"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Architecture</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997730"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997731"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Jaxb: marshalling and unmarshalling</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997731"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997732"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Parts List</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997732"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997733"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">MainDocumentPart</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997733"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997734"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Samples</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997734"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997735"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Creating a new docx</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997735"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997736"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">docx4j.properties</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997736"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997737"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Adding a paragraph of text</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997737"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997738"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">General strategy/approach for creating stuff</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997738"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997739"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Formatting Properties</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997739"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997740"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Creating and adding a table</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997740"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997741"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Selecting your insertion/editing point;  accessing JAXB nodes via XPath</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997741"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997742"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Traversing a document</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997742"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997743"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Adding a Part</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997743"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997744"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Importing XHTML</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997744"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997745"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">docx to (X)HTML</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997745"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997746"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">docx to PDF</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997746"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997747"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Image Handling - DOCX</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997747"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997748"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Manual Image Manipulation</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997748"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997749"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Image Handling – PPTX</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997749"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997750"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Adding Headers/Footers</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997750"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997751"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Protection Settings</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997751"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997752"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">docx Table of Contents</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997752"><span>1</span></a></a></p>
  
  <p class="TOC2 Normal DocDefaults "><a href="#_Toc41997753"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Introduction</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997753"><span>1</span></a></a></p>
  
  <p class="TOC2 Normal DocDefaults "><a href="#_Toc41997754"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Field background</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997754"><span>1</span></a></a></p>
  
  <p class="TOC2 Normal DocDefaults "><a href="#_Toc41997755"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">TOC Content Control</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997755"><span>1</span></a></a></p>
  
  <p class="TOC2 Normal DocDefaults "><a href="#_Toc41997756"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">TOC Field Syntax</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997756"><span>1</span></a></a></p>
  
  <p class="TOC2 Normal DocDefaults "><a href="#_Toc41997757"><span class="Hyperlink DefaultParagraphFont "><span class="" style="font-family: 'Liberation Sans';">Inserting/generating a TOC </span><span class="" style="">– </span><span class="" style="font-family: 'Liberation Sans';">"pure Java" considerations</span></span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997757"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997758"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Text extraction</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997758"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997759"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Text substitution</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997759"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997760"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Text substitution via data bound content controls</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997760"><span>1</span></a></a></p>
  
  <p class="TOC2 Normal DocDefaults "><a href="#_Toc41997761"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Binding extensions for repeats and conditionals</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997761"><span>1</span></a></a></p>
  
  <p class="TOC2 Normal DocDefaults "><a href="#_Toc41997762"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Binding escaped XHTML (XML + CSS)</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997762"><span>1</span></a></a></p>
  
  <p class="TOC2 Normal DocDefaults "><a href="#_Toc41997763"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Binding other rich content</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997763"><span>1</span></a></a></p>
  
  <p class="TOC2 Normal DocDefaults "><a href="#_Toc41997764"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Authoring</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997764"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997765"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Mailmerge</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997765"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997766"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">SmartArt</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997766"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997767"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">JAXB stuff</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997767"><span>1</span></a></a></p>
  
  <p class="TOC2 Normal DocDefaults "><a href="#_Toc41997768"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Cloning</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997768"><span>1</span></a></a></p>
  
  <p class="TOC2 Normal DocDefaults "><a href="#_Toc41997769"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">javax.xml.bind.JAXBElement</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997769"><span>1</span></a></a></p>
  
  <p class="TOC2 Normal DocDefaults "><a href="#_Toc41997770"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">@XmlRootElement</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997770"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997771"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Merging Documents and Presentations</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997771"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997772"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Other Support Options</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997772"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997773"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Colophon</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997773"><span>1</span></a></a></p>
  
  <p class="TOC1 Normal DocDefaults "><a href="#_Toc41997774"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Contacting Plutext</span><span class="DefaultParagraphFont ">   </span><a href="#_Toc41997774"><span>1</span></a></a></p>
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-weight: bold;" /></p>
  
  <p class="Normal DocDefaults "> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">This guide is for docx4j </span><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'Liberation Sans';">8.2.0</span><span class="" style="font-family: 'Liberation Sans';">.</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">  The </span><span class="" style="font-family: 'Liberation Sans';">8.x series will be the last series to run under Java 1.8</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> (hence the name). </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">There are 2 significant changes in docx4j 8.0.0:</span></p><ol>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">The project is now structured as a maven multi-module project</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">You'll need one and only one of the docx4j-JAXB-</span><span style="font-family: 'Liberation Sans';">[Internal|MOXy|ReferenceImpl] artifacts and its deps</span></li></ol>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">The latest version of this document can always be found in </span><a href="https://github.com/plutext/docx4j/tree/master/docs"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">docx4j on GitHub in /docs</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;" /><span class="" style="font-family: 'Liberation Sans';">.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">There is also a handy 1 page summary at </span><a href="https://www.docx4java.org/docx4j/plutext-docx4j_on_a_page-v300.pdf"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">https://www.docx4java.org/docx4j/plutext-docx4j_on_a_page-v300.pdf</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> </span><span class="" style="font-family: 'Liberation Sans';">(look out for an update soon).</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">The most up to date copy of this document is in English.  There is also a Russian version.  From time to time, it may be machine translated into other languages.  Please let us know if you are interested in writing some basic documentation in your own language (either as a contribution, or for a fee). </span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997707" /><span style="font-family: 'Liberation Serif';">What is docx4j?</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">docx4j is a library for </span><span class="" style="font-family: 'Liberation Sans';">working with docx, pptx and xlsx files in Java.  In essence, it can unzip a</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> docx </span><span class="" style="font-family: 'Liberation Sans';">(or pptx/xlsx) "package", and parse</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> the XML to create an in-memory representation in </span><span class="" style="font-family: 'Liberation Sans';">Java</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> using developer friendly classes (as opposed to DOM or SAX).  </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">docx4j is usually deployed as part of a web application (eg on Tomcat, JBOSS, WebSphere etc </span><span class="" style="">– </span><span class="" style="font-family: 'Liberation Sans';">see the deployment forums).</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">docx4j</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> is similar in concept to Microsoft's  OpenXML SDK, which is for .NET.  docx4j.NET is available for the NET platform; see further below.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">A distinctive strength of docx4j is that its in-memory representation uses </span><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'Liberation Sans';">JAXB</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">, the JCP standard for Java - XML binding.  </span><span class="" style="font-family: 'Liberation Sans';">Docx4j is the only library for working with OpenXML files which uses/supports JAXB (each of</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> the Sun/Oracle</span><span class="" style="font-family: 'Liberation Sans';">,</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> MOXy </span><span class="" style="font-family: 'Liberation Sans';">and IBM</span><span class="FootnoteReference DefaultParagraphFont " style="vertical-align: top; font-size: xx-small"><a name="fs1"><a href="#fn1">1</a></a></span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> implementations).  </span><span class="" style="font-family: 'Liberation Sans';">In contrast, Apache POI uses XML Beans.</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">  (Aspose in contrast, does not provide low-level access to the underlying XML or a corresponding object model, so "you can't do it" unless Aspose provides support for it).  </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">docx4j is open source, available under the Apache License (v2).  As an open source project, docx4j has been substantially improved by a number of contributions (see the README or POM file for contributors), and further contributions are always welcome.  Please see the docx4j forum at </span><a href="http://www.docx4java.org/forums/"><span class="DefaultParagraphFont " style="color: #0000FF;text-decoration: underline;;font-family: 'Liberation Sans';">http://</span><span class="DefaultParagraphFont " style="color: #0000FF;text-decoration: underline;;font-family: 'Liberation Sans';">www.docx4java</span><span class="DefaultParagraphFont " style="color: #0000FF;text-decoration: underline;;font-family: 'Liberation Sans';">.org/forums/</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> for details.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">The docx4j project is sponsored by Plutext (</span><a href="http://www.plutext.com"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">www.plutext.com</span></a><span class="" style="font-family: 'Liberation Sans';">).</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">There is also a commercial enterprise edition of docx4j, which comes with commercial support and additional functionality not found in the community edition.  Additional functionality includes:</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Merging documents or presentations</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">OLE embedding of files in docx, pptx, xlsx</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Digital signatures</span></li></ul>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997708" /><span style="font-family: 'Liberation Serif';">What sorts of things can you do with docx4j?</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Open existing docx (from filesystem, SMB/CIFS, WebDAV using VFS), pptx, xlsx</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Create new docx, pptx, xlsx</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Programmatically manipulate the above (of course)</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Save to various media zipped, or unzipped</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Protection settings</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Produce/consume  the Flat OPC XML format</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Do all this on Android.</span></li></ul>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Specific to docx4j (as opposed to pptx4j, xlsx4j):</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Import XHTML</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Export as (X)HTML or PDF</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Template substitution; CustomXML binding</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Mail merge</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Apply transforms, including common filters</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Diff/compare documents, paragraphs or sdt (content controls)</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Font support (font substitution, and use of any fonts embedded in the document)</span></li></ul>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">This document focuses primarily on docx4j, but the general principles are equally applicable to pptx4j and xlsx4j.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997709" /><span style="font-family: 'Liberation Serif';">Is docx4j for you?</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Docx4j is for processing docx documents (and pptx presentations and xlsx spreadsheets) in Java.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">It isn't for old binary (.doc) files.  If you wish to invest your effort around docx (as is wise), but you also need to be able to handle old doc files, see further below for your options. </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Nor is it for RTF files.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997710" /><span style="font-family: 'Liberation Serif';">GraalVM</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Programs based on docx4j can be converted to a Graal native image, and run "serverless" on AWS Lambda.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997711" /><span style="font-family: 'Liberation Serif';">docx4j.NET</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">If you want to process docx/pptx/xslsx on the .NET platform, you should </span><span class="" style="font-family: 'Liberation Sans';">consider</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> Microsoft's </span><span class="" style="font-family: 'Liberation Sans';">OpenXML SDK.</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">  That said, docx4j can be used in a .NET environment via IKVM, and there are several reasons you might wish to do this:</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Where you need docx4j</span><span>’</span><span style="font-family: 'Liberation Sans';">s capabilities, for example:</span></li><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">XHTML import</span><span style="font-family: 'Liberation Sans';">/export/roundtrip</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">PDF export</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">OpenDoPE processing</span></li></ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">Capabilities provided by docx4j </span><span style="font-family: 'Liberation Sans';">enterprise edition (as to which see above)</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Where you need to work in both Java and .NET, and want to use a single API in both environments</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">Where you need the source code (Microsoft doesn</span><span>’</span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">t </span><span style="font-family: 'Liberation Sans';">provide that)</span></li></ul>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">You can use docx4j.NET and the OpenXML SDK together; see </span><a href="https://github.com/plutext/docx4j.NET/blob/master/docx4j.NET/src/samples/c%23/Docx4NET/InteropDocx.cs"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">InteropDocx</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;" /></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">As on the Java platform, docx4j.NET comes in community and commercial editions.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">See </span><a href="https://www.nuget.org/packages/docx4j.NET/"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">https://www.nuget.org/packages/docx4j.NET/</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;" /></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997712" /><span style="font-family: 'Liberation Serif';">What Word documents does it support?</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Docx4j can read/write docx documents created by or for Word 2007</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> or later, </span><span class="" style="font-family: 'Liberation Sans';">plus</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> earlier versions which have the compatibility pack installed. (Same goes for xlsx spreadsheets and pptx presentations).</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">The relevant parts of docx4j are generated from the ECMA schemas</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">, with the addition of the key </span><span class="" style="font-family: 'Liberation Sans';">Microsoft proprietary extensions.</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">  For unsupported extensions, docx4j gracefully degrades to the specified 2007 substitutes.</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">It </span><span class="" style="font-family: 'Liberation Sans';">is not really intended</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> read/write Word 2003 XML documents, although </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">package</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> org.docx4j.convert.in.word2003xml </span></span><span class="" style="font-family: 'Liberation Sans';">is a proof of concept of importing such documents.</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">For more information, please see </span><a href="#_Ref280708892"><span class="DefaultParagraphFont " style="font-weight: bold;font-style: italic;;font-family: 'Liberation Sans';">Specification versions</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> below.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997713" /><span style="font-family: 'Liberation Serif';">Handling legacy binary .doc files</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">An effective approach is to use LibreOffice or OpenOffice (via jodconverter) to convert the doc to docx, which docx4j can then process.  If you need to return a binary .doc, LibreOffice or </span><span class="" style="font-family: 'Liberation Sans';">OpenOffice/jodconverter can convert the docx back to .doc.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">With 8.2.0, docx4j can also convert binary .doc or RTF to docx, using Microsoft Word courtesy of documents4j.   The sub-projects docx4j-documents4j-local and docx4j-documents4j-remote provide an interface to documents4j which is convenient for docx4j users.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997714" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Getting Help: the docx4j forum</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Free community support is available in the docx4j forum, at </span><a href="http://www.docx4java.org/forums/"><span class="DefaultParagraphFont " style="color: #0000FF;text-decoration: underline;;font-family: 'Liberation Sans';">http://www.docx4java.org/forums/</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;" /><span class="DefaultParagraphFont " style="color: #0000FF;text-decoration: underline;;font-family: 'Liberation Sans';white-space:pre-wrap;"> </span><span class="" style="font-family: 'Liberation Sans';">and on Stack Overflow.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Before posting, please:</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">check this document doesn</span><span>’</span><span style="font-family: 'Liberation Sans';">t answer your question</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">try to help yourself: people are unlikely to help you if it looks like you are asking someone else to do lots of work you presumably are being paid to do!</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">ensure your post says which version of docx4j you are using, and contains your Java code (between [java] .. and .. [/java]) and XML (between [xml] .. and .. [/xml])</span><span style="font-family: 'Liberation Sans';">, and if appropriate a docx/pptx/xlsx attachment</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">consider browsing relevant docx4j source code </span></li></ul>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">This discussion is generally in English.  If you </span><span class="" style="font-family: 'Liberation Sans';">would like</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> to moderate a forum in another language (for example, French, Chinese, Spanish</span><span class="" style="">…</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">), please let us know.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997715" /><span style="font-family: 'Liberation Serif';">A word about Jaxb</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">docx4j uses JAXB to marshall and unmarshall the XML parts in a docx/pptx/xlsx.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Docx4j supports each of the 3 JAXB implementations:</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">the JAXB in Java 8 implementation; to use this, you need the </span><span style="font-family: 'Liberation Sans';">docx4j-JAXB-Internal</span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;"> </span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">jar. You can also use this with Java 9.  But not Java 11, since </span><span style="font-family: 'Liberation Sans';">Java 11 does not ship JAXB anymore.</span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;"> </span><br /></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">the Sun/Oracle/"Reference" implementation</span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">; to use this you need </span><span style="font-family: 'Liberation Sans';">docx4j-JAXB-ReferenceImpl</span></li></ul>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;"><span class="" style="font-family: 'Liberation Sans';">You can also use the JAXB reference implementation (eg v2.2.4).  If you want to use that in preference to the version included in the JDK, do so using the endorsed directory mechanism.</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Moxy</span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">.  To use this, you need </span><span style="font-family: 'Liberation Sans';">docx4j-JAXB-MOXy</span><span style="font-family: 'Liberation Sans';">.</span><br /></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">IBM's (in WebSphere).  </span><span style="font-family: 'Liberation Sans';">By default, WebSphere uses com.ibm.xml.xlxp2.jaxb, which has the concept of fallback/ MarshallerProxy.  The actual implementation it uses is in com.ibm.jaxb.tools.jar.</span></li></ul>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997716" /><span style="font-family: 'Liberation Serif';">Using docx4j via Maven</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">docx4j is in Maven Central.  For Maven users, t</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">his makes it really easy to get going with docx4j.  </span></p>
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';">To use docx4j 8.2</span><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">.0, add </span><span class="" style="font-family: 'Liberation Sans';">one and only one of the following to your project:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"><span class="DefaultParagraphFont " style="font-size: 8.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;!-- use the JAXB shipped in Java 8 --&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"><span class="DefaultParagraphFont " style="font-size: 8.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;dependency&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"><span class="DefaultParagraphFont " style="font-size: 8.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;groupId&gt;org.docx4j&lt;/groupId&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"><span class="DefaultParagraphFont " style="font-size: 8.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;artifactId&gt;</span></span><span class="DefaultParagraphFont " style="font-weight: bold;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">docx4j-JAXB-</span><span class="DefaultParagraphFont " style="font-weight: bold;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">Internal</span><span class="DefaultParagraphFont " style="font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;/artifactId&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"><span class="DefaultParagraphFont " style="font-size: 8.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;version&gt;8.</span></span><span class="DefaultParagraphFont " style="font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">2.0&lt;/version&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"><span class="DefaultParagraphFont " style="font-size: 8.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;/dependency&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"><span class="DefaultParagraphFont " style="font-size: 8.0pt;">      </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"><span class="DefaultParagraphFont " style="font-size: 8.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;!-- use the JAXB Reference Implementation --&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"><span class="DefaultParagraphFont " style="font-size: 8.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;dependency&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"><span class="DefaultParagraphFont " style="font-size: 8.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;groupId&gt;org.docx4j&lt;/groupId&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"><span class="DefaultParagraphFont " style="font-size: 8.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;artifactId&gt;</span></span><span class="DefaultParagraphFont " style="font-weight: bold;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">docx4j-JAXB-</span><span class="DefaultParagraphFont " style="font-weight: bold;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">ReferenceImpl</span><span class="DefaultParagraphFont " style="font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;/artifactId&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"><span class="DefaultParagraphFont " style="font-size: 8.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;version&gt;8.</span></span><span class="DefaultParagraphFont " style="font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">2.0&lt;/version&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"><span class="DefaultParagraphFont " style="font-size: 8.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;/dependency&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"><span class="DefaultParagraphFont " style="font-size: 8.0pt;">      </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"><span class="DefaultParagraphFont " style="font-size: 8.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;!-- use the MOXy JAXB implementation --&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"><span class="DefaultParagraphFont " style="font-size: 8.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;dependency&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"><span class="DefaultParagraphFont " style="font-size: 8.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;groupId&gt;org.docx4j&lt;/groupId&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"><span class="DefaultParagraphFont " style="font-size: 8.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;artifactId&gt;</span></span><span class="DefaultParagraphFont " style="font-weight: bold;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">docx4j-JAXB-</span><span class="DefaultParagraphFont " style="font-weight: bold;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">MOXy</span><span class="DefaultParagraphFont " style="font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;/artifactId&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"><span class="DefaultParagraphFont " style="font-size: 8.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;version&gt;8.</span></span><span class="DefaultParagraphFont " style="font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">2.0&lt;/version&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"><span class="DefaultParagraphFont " style="font-size: 8.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;/dependency&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;"> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">The blog entry </span><a href="http://www.docx4java.org/blog/2011/10/hello-maven-central/"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">hello-maven-central</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;" /><span class="" style="font-family: 'Liberation Sans';">s</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> [needs to be updated per above] s</span><span class="" style="font-family: 'Liberation Sans';">hows you what to do, starting with a fresh OS (Win 7 is used, but these steps would work equally well on OSX or Linux).</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997717" /><span style="font-family: 'Liberation Serif';">Using docx4j binaries</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">If Maven is not for you, y</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">ou can download the latest version of docx4j from </span><a href="http://www.docx4java.org/docx4j/"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">http://</span><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">www.docx4java</span><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">.org/docx4j/</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;" /></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Supporting jars can be found in the .tar.gz or zip version, or in the relevant subdirectory.  </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">You'll need the jars from one and only one of these directorie</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">s: </span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">docx4j-JAXB-Internal, </span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">docx4j-JAXB-ReferenceImpl, </span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">docx4j-JAXB-MOXy</span></li></ul>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997718" /><span style="font-family: 'Liberation Serif';">docx4j dependencies</span></p>
  
  <p class="Heading2 Normal DocDefaults "><a name="_Toc41997719" /><span style="font-family: 'Liberation Serif';">slf</span><span style="font-family: 'Liberation Serif';">4j</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">To do anything with docx4j, you need </span><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'Liberation Sans';">slf4j</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> on your classpath.  As the slf4j website puts it:</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;"><span class="DefaultParagraphFont " style="color: #777777;background-color: #FFFFFF;font-size: 10.0pt;"><span class="" style="font-family: 'Noto Sans Gurmukhi UI Medium';">The Simple Logging Facade for Java (SLF4J) serves as a simple facade or abstraction for various logging frameworks (e.g. java.util.logging, logback, log4j) allowing the end user to plug in the desired logging framework at </span></span><span class="Emphasis DefaultParagraphFont " style="color: #777777;background-color: #FFFFFF;font-size: 10.0pt;;font-family: 'Noto Sans Gurmukhi UI Medium';">deployment</span><span class="apple-converted-space DefaultParagraphFont " style="color: #777777;background-color: #FFFFFF;font-size: 10.0pt;;font-family: 'Noto Sans Gurmukhi UI Medium';"> </span><span class="DefaultParagraphFont " style="color: #777777;background-color: #FFFFFF;font-size: 10.0pt;;font-family: 'Noto Sans Gurmukhi UI Medium';">time.</span></p>
  
  <p class="NormalWeb Normal DocDefaults " style="border-color: #FFFFFF; border-style:solid; border-width:1px;background-color: #FFFFFF;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'Noto Sans Gurmukhi UI Medium';">So you need the slf4j api jar on your classpath:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'Noto Sans Gurmukhi UI Medium';white-space:pre-wrap;">  </span><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">&lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">dependency</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">groupId</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">org.slf4j</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;/</span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">groupId</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">artifactId</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">slf4j-api</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;/</span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">artifactId</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">version</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">1.7.5</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;/</span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">version</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  &lt;/</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">dependency</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="NormalWeb Normal DocDefaults " style="border-color: #FFFFFF; border-style:solid; border-width:1px;background-color: #FFFFFF;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'Noto Sans Gurmukhi UI Medium';">If you want to use logback, then include it:</span></p>
  
  <p class="NormalWeb Normal DocDefaults " style="border-color: #FFFFFF; border-style:solid; border-width:1px;background-color: #FFFFFF;margin-top: 0in;margin-bottom: 0in;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.5pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;dependency&gt;</span></span></p>
  
  <p class="NormalWeb Normal DocDefaults " style="border-color: #FFFFFF; border-style:solid; border-width:1px;background-color: #FFFFFF;margin-top: 0in;margin-bottom: 0in;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.5pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;</span></span></p>
  
  <p class="NormalWeb Normal DocDefaults " style="border-color: #FFFFFF; border-style:solid; border-width:1px;background-color: #FFFFFF;margin-top: 0in;margin-bottom: 0in;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.5pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  &lt;artifactId&gt;logback-classic&lt;/artifactId&gt;</span></span></p>
  
  <p class="NormalWeb Normal DocDefaults " style="border-color: #FFFFFF; border-style:solid; border-width:1px;background-color: #FFFFFF;margin-top: 0in;margin-bottom: 0in;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.5pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  &lt;version&gt;1.3.0-alpha4&lt;/version&gt;</span></span></p>
  
  <p class="NormalWeb Normal DocDefaults " style="border-color: #FFFFFF; border-style:solid; border-width:1px;background-color: #FFFFFF;margin-top: 0in;margin-bottom: 0in;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.5pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;/dependency&gt;</span></span></p>
  
  <p class="NormalWeb Normal DocDefaults " style="border-color: #FFFFFF; border-style:solid; border-width:1px;background-color: #FFFFFF;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'Noto Sans Gurmukhi UI Medium';">If you want to use log4j, then include it, and:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">dependency</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">groupId</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">org.slf4j</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;/</span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">groupId</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">artifactId</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">slf4j-log4j12</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;/</span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">artifactId</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">version</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">1.7.5</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;/</span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">version</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  &lt;/</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">dependency</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Heading2 Normal DocDefaults "><a name="_Toc41997720" /><span style="font-family: 'Liberation Serif';">other dependencies</span><span style="font-family: 'Liberation Serif';white-space:pre-wrap;"> </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Depending what you want to do, the other</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> dependencies will be required.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Best practice is to include all dependencies on your class path, and be done with it.  </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">In your development environment, you can do this using Maven, or by physically copying them all to your classpath.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">For your deployment environment, your build process ought to be set up to do this for you.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997721" /><span style="font-family: 'Liberation Serif';">Docx4j source code</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Docx4j</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> source is on GitHub at </span><a href="https://github.com/plutext/docx4j"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">https://github.com/plutext/docx4j</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> .  </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">We accept pull requests; pull requests are presumed to be contributions under ASLv2 per our contributor agreement.  </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">See </span><a href="http://www.docx4java.org/blog/2012/05/docx4j-from-github-in-eclipse/"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">docx4j-from-github-in-eclipse</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> for details.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Source code can also be downloaded from Maven Central (search for docx4j at search.maven.org).</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997722" /><span style="font-family: 'Liberation Serif';">Javadoc</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Javadoc can be downloaded from Maven Central (search for docx4j at search.maven.org), but you</span><span class="" style="">’</span><span class="" style="font-family: 'Liberation Sans';">ll find the source code much more useful!  See above.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997723" /><span style="font-family: 'Liberation Serif';">Building docx4j from source</span><span style="font-family: 'Liberation Serif';white-space:pre-wrap;"> </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Get the source code from GitHub (see above), then</span><span class="" style="">…</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> (you probably want to skip down to the next page, to get it working in Eclipse).</span></p>
  
  <p class="Heading2 Normal DocDefaults "><a name="_Toc41997724" /><span style="font-family: 'Liberation Serif';">Command line -via Maven</span></p>
  
  <p class="Command NormalWeb Normal DocDefaults "><span class="apple-style-span DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';">export MAVEN_OPTS=-Xmx512m</span><span class="DefaultParagraphFont " style="color: #000000;"><br /></span><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">mvn install </span></p>
  
  <p class="Heading2 Normal DocDefaults " style="page-break-after: avoid;"><a name="_Toc41997725" /><span style="font-family: 'Liberation Serif';">Eclipse</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">See </span><a href="http://www.docx4java.org/blog/2012/05/docx4j-from-github-in-eclipse/"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">docx4j-from-github-in-eclipse</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;" /><span class="" style="font-family: 'Liberation Sans';">.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Not working?</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Enable Maven (make sure you have Maven and its plugin installed - see Prerequisites above):</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">with Eclipse Indigo</span></li><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Right click on the project</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Click "Configure &gt; Convert to Maven Project"</span></li></ul></ul>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">compiler version &amp; system library:</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Right click on the project (or Alt-Enter)</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Choose "Java Compiler", then set JDK compliance to 1.</span><span style="font-family: 'Liberation Sans';">8</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">Choose "Java Build Path", and check you are using 1.</span><span style="font-family: 'Liberation Sans';">8</span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;"> </span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">"JRE System Library". If not, remove, then click "Add Library"</span></li></ul>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">The project should now be working in Eclipse without errors</span><span class="FootnoteReference DefaultParagraphFont " style="vertical-align: top; font-size: xx-small"><a name="fs2"><a href="#fn2">2</a></a></span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">. </span></p>
  
  <p class="Heading2 Normal DocDefaults "><a name="_Toc41997726" /><span style="font-family: 'Liberation Serif';">Using a different IDE?</span></p>
  
  <p class="Normal DocDefaults "><span class="underline DefaultParagraphFont " style="font-family: 'Liberation Sans';">Please post setup instructions in the forum, or as a wiki page on GitHub.  Thanks!</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997727" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Open an existing docx/pptx/xlsx document</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><a href="http://dev.plutext.org/trac/docx4j/trac/docx4j/browser/trunk/docx4j/src/main/java/org/docx4j/openpackaging/packages/WordprocessingMLPackage.java"><span class="DefaultParagraphFont " style="font-family: 'DejaVu Sans Mono Bold';">org.docx4j.openpackaging.packages.</span><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'DejaVu Sans Mono Bold';">WordprocessingMLPackage</span></a><span style="font-family: 'Liberation Sans';"> represents a docx document.</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">To load a document</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> or </span><span class="" style="">“</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Flat OPC</span><span class="" style="">” </span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">XML file</span><span class="" style="font-family: 'Liberation Sans';">, all you have to do is:</span></p>
  
  <p class="Command NormalWeb Normal DocDefaults " style="position: relative; margin-left: 0in;">   <span style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">WordprocessingMLPackage wordMLPackage = </span><br />      <span style="font-family: 'DejaVu Sans Mono Bold';">WordprocessingMLPackage.load(new java.io.File(inputfilepath));</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">You can use the façade:</span></p>
  
  <p class="Command NormalWeb Normal DocDefaults " style="position: relative; margin-left: 0in;">   <span style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">WordprocessingMLPackage wordMLPackage = </span><br />      <span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'DejaVu Sans Mono Bold';">Docx4J</span><span style="font-family: 'DejaVu Sans Mono Bold';">.load(new java.io.File(inputfilepath));</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">which does the same thing under the covers.</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">There are similar signatures to load from an input stream.  </span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">You can then get the main document part (word/document.xml):</span></p>
  
  <p class="Command NormalWeb Normal DocDefaults "><a href="http://dev.plutext.org/trac/docx4j/trac/docx4j/browser/trunk/docx4j/src/main/java/org/docx4j/openpackaging/parts/WordprocessingML/MainDocumentPart.java"><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';">MainDocumentPart</span></a><span style="font-family: 'DejaVu Sans Mono Bold';"> documentPart = wordMLPackage.getMainDocumentPart();</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">After that, you can manipulate its contents. </span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">A similar approach works for pptx files:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">PresentationMLPackage presentationMLPackage = </span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">(PresentationMLPackage)OpcPackage.</span></span><span class="DefaultParagraphFont " style="color: #000000;font-style: italic;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">load</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">(</span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">new</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> java.io.File(inputfilepath));</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">And similarly for xlsx files.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997728" /><span style="font-family: 'Liberation Serif';">OpenXML</span><span style="font-family: 'Liberation Serif';white-space:pre-wrap;"> </span><span style="font-family: 'Liberation Serif';white-space:pre-wrap;">concepts</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">To do anything much beyond this, you need to have an understanding of basic WordML concepts</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> (or PresentationML or SpreadsheetML)</span><span class="" style="font-family: 'Liberation Sans';">.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">According to the Microsoft Open Packaging spec, each docx document is made up of a number of </span><span class="" style="">“</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Part</span><span class="" style="">” </span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">files, zipped up.  </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">An easy way to get an understanding of this is to unzip a docx/pptx/xlsx using your favourite zip utility.  Even easier is to visit </span><a href="http://webapp.docx4java.org"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">http://webapp.docx4java.org</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">  and explore your file using </span><span class="" style="">“</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">PartsList</span><span class="" style="">”</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">.  You can also generate code that way.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">A Part is usually XML, but might not be (an image part, for example, isn't).</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">The parts form a tree. If a part has child parts, it must have a relationships part which identifies these.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">The part which contains the main text of the document is the Main Document Part.  Each Part has a name.  The name of the Main Document Part is usually "/word/document.xml".</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">If the document has a header, then the main document part woud have a header child part, and this would be described in the main document part's relationships (part).</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Similarly for any images.  To see the structure of any given document, </span><a href="http://webapp.docx4java.org/OnlineDemo/PartsList.html"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">upload it to the PartsList webapp</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">, or run the "Parts List" sample (see </span><span class="" style="font-family: 'Liberation Sans';">further below).</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">An introduction to WordML is beyond the scope of this document.  You can find a very readable introduction in 1</span><span class="DefaultParagraphFont " style="vertical-align: super;font-size: smaller;;font-family: 'Liberation Sans';">st</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> edition Part 3 (Primer) at </span><a href="http://www.ecma-international.org/publications/standards/Ecma-376.htm"><span class="DefaultParagraphFont " style="color: #0000FF;text-decoration: underline;;font-family: 'Liberation Sans';">http://www.ecma-international.org/publications/standards/Ecma-376.htm</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> or </span><a href="http://www.ecma-international.org/news/TC45_current_work/TC45_available_docs.htm"><span class="DefaultParagraphFont " style="color: #0000FF;text-decoration: underline;;font-family: 'Liberation Sans';">http://www.ecma-international.org/news/TC45_current_work/TC45_available_docs.htm</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> (a better link for the 1st edition (Dec 2006), since its not zipped up). </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">See also the free </span><a href="http://openxmldeveloper.org/cfs-file.ashx/__key/communityserver-components-postattachments/00-00-00-19-70/Open-XML-Explained.pdf"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">"Open XML Explained" ebook</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> </span><span class="" style="font-family: 'Liberation Sans';">by Wouter Van Vugt</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">.  </span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Ref280708892" /><a name="_Toc41997729" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Specification versions</span><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';white-space:pre-wrap;"> </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">From Wikipedia:</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;"><span class="apple-style-span DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';">The</span><span class="apple-converted-space DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';"> </span><a alt="Office Open XML" href="http://en.wikipedia.org/wiki/Office_Open_XML"><span class="Hyperlink DefaultParagraphFont " style="color: #0645AD;;font-family: 'Liberation Sans';">Office Open XML</span></a><span class="apple-converted-space DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';"> </span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';white-space:pre-wrap;">file formats were standardised between December 2006 and November 2008, </span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 1in;"><span class="apple-style-span DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';">first by the</span><span class="apple-converted-space DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';"> </span><a alt="Ecma International" href="http://en.wikipedia.org/wiki/Ecma_International"><span class="Hyperlink DefaultParagraphFont " style="color: #0645AD;;font-family: 'Liberation Sans';">Ecma International</span></a><span class="apple-converted-space DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';"> </span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';">consortium (where they became</span><span class="apple-converted-space DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';"> </span><span class="apple-style-span DefaultParagraphFont " style="font-weight: bold;color: #000000;;font-family: 'Liberation Sans';">ECMA-376</span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';white-space:pre-wrap;">), </span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 1in;"><span class="apple-style-span DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';">and subsequently .. by the</span><span class="apple-converted-space DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';"> </span><a alt="International Organization for Standardization" href="http://en.wikipedia.org/wiki/International_Organization_for_Standardization"><span class="Hyperlink DefaultParagraphFont " style="color: #0645AD;;font-family: 'Liberation Sans';">ISO</span></a><span class="apple-converted-space DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';" /><span class="apple-style-span DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';">/</span><a alt="International Electrotechnical Commission" href="http://en.wikipedia.org/wiki/International_Electrotechnical_Commission"><span class="Hyperlink DefaultParagraphFont " style="color: #0645AD;;font-family: 'Liberation Sans';">IEC</span></a><span class="apple-style-span DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';">'s</span><span class="apple-converted-space DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';"> </span><a alt="International Organization for Standardization" href="http://en.wikipedia.org/wiki/International_Organization_for_Standardization#ISO.2FIEC_Joint_Technical_Committee_1"><span class="Hyperlink DefaultParagraphFont " style="color: #0645AD;;font-family: 'Liberation Sans';">Joint Technical Committee 1</span></a><span class="apple-converted-space DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';"> </span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';">(where they became</span><span class="apple-converted-space DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';"> </span><span class="apple-style-span DefaultParagraphFont " style="font-weight: bold;color: #000000;;font-family: 'Liberation Sans';">ISO/IEC 29500:2008</span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';">).</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">The Ecma-376.htm link also contains the 2nd edition documents (of Dec 2008), which are </span><span class="apple-converted-space DefaultParagraphFont " style="color: #333333;;font-family: 'Liberation Sans';">"</span><span class="apple-style-span DefaultParagraphFont " style="color: #333333;;font-family: 'Liberation Sans';">technically aligned with ISO/IEC 29500".</span></p>
  
  <p class="Normal DocDefaults "><span class="apple-style-span DefaultParagraphFont " style="color: #333333;;font-family: 'Liberation Sans';">Office 2007 SP2 implements ECMA-376 1st Edition</span><span class="FootnoteReference DefaultParagraphFont " style="color: #333333;;vertical-align: top; font-size: xx-small"><a name="fs3"><a href="#fn3">3</a></a></span><span class="apple-style-span DefaultParagraphFont " style="color: #333333;;font-family: 'Liberation Sans';white-space:pre-wrap;">; this is what docx4j </span><span class="apple-style-span DefaultParagraphFont " style="color: #333333;;font-family: 'Liberation Sans';">started with</span></p>
  
  <p class="Normal DocDefaults "><span class="apple-style-span DefaultParagraphFont " style="color: #333333;;font-family: 'Liberation Sans';">ISO/IEC 29500 (ECMA-376 2nd Edition) has</span><span class="apple-converted-space DefaultParagraphFont " style="color: #333333;;font-family: 'Liberation Sans';"> </span><span class="apple-style-span DefaultParagraphFont " style="color: #333333;font-style: italic;;font-family: 'Liberation Sans';">Strict</span><span class="apple-converted-space DefaultParagraphFont " style="color: #333333;;font-family: 'Liberation Sans';"> </span><span class="apple-style-span DefaultParagraphFont " style="color: #333333;;font-family: 'Liberation Sans';">and</span><span class="apple-converted-space DefaultParagraphFont " style="color: #333333;;font-family: 'Liberation Sans';"> </span><span class="apple-style-span DefaultParagraphFont " style="color: #333333;font-style: italic;;font-family: 'Liberation Sans';white-space:pre-wrap;">Transitional </span><span class="apple-style-span DefaultParagraphFont " style="color: #333333;;font-family: 'Liberation Sans';">conformance classes.  Office 2010 supports</span><span class="FootnoteReference DefaultParagraphFont " style="color: #333333;;vertical-align: top; font-size: xx-small"><a name="fs4"><a href="#fn4">4</a></a></span><span class="apple-style-span DefaultParagraphFont " style="color: #333333;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> transitional, and also has read only support for strict.</span></span></p>
  
  <p class="Normal DocDefaults "><span class="apple-style-span DefaultParagraphFont " style="color: #333333;;font-family: 'Liberation Sans';">docx4j started with</span><span class="apple-style-span DefaultParagraphFont " style="color: #333333;;font-family: 'Liberation Sans';white-space:pre-wrap;"> </span><span class="apple-style-span DefaultParagraphFont " style="color: #333333;;font-family: 'Liberation Sans';">ECMA-376 1st Edition.</span><span class="apple-style-span DefaultParagraphFont " style="color: #333333;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">  Where appropriate later versions of the schemas are used.  docx4j 3.0 uses MathML 2ed, PresentationML 2ed, and SpreadsheemML 4ed transitional.</span></span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Docx4j can open documents which contain Word 2010, 2013</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> specific </span><span class="" style="font-family: 'Liberation Sans';">content.</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">  The key extensions are supported.  For other stuff</span><span class="" style="font-family: 'Liberation Sans';">, for example,  &lt;w14:glow w14:rad="101600"&gt;  it will look for and try to use mc:AlternateContent contained in the document.</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">  If you use docx4j to save the document, the w14:glow won</span><span class="" style="">’</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">t be there any more (ie the docx will effectively be a Word 2007 docx).</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997730" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Architecture</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Docx4j has 3 layers:</span></p><ol>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.openpackaging</span><br /><br /><span style="font-family: 'Liberation Sans';">OpenPackaging handles things at the O</span><span style="font-family: 'Liberation Sans';">pen Packaging Conventions level.</span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;"> </span><br /><br /><span style="font-family: 'Liberation Sans';">It includes objects corresponding to each Office file type</span><span style="font-family: 'Liberation Sans';">:</span></li></ol>
  
  <p class="ListParagraph Normal DocDefaults "> </p>
  
  <table class="TableGrid TableNormal " id="docx4j_tbl_0" style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;position: relative; margin-left: 19mm;table-layout: fixed;vertical-align: top;border-collapse: collapse;width: 5.89in;"><colgroup><col style="width: 21.73%;" /><col style="width: 78.27%;" /></colgroup><tbody><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="ListParagraph-TableGrid-BR DocDefaults " style="position: relative; margin-left: 0in;"><span class="" style="font-family: 'Liberation Sans';">docx</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="ListParagraph-TableGrid-BR DocDefaults " style="position: relative; margin-left: 0in;"><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';">org.docx4j.openpackaging.packages.</span><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'Liberation Sans';">WordprocessingMLPackage</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="ListParagraph-TableGrid-BR DocDefaults " style="position: relative; margin-left: 0in;"><span class="" style="font-family: 'Liberation Sans';">pptx</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="ListParagraph-TableGrid-BR DocDefaults " style="position: relative; margin-left: 0in;"><span class="" style="font-family: 'Liberation Sans';">org.docx4j.openpackaging.packages.</span><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'Liberation Sans';">PresentationMLPackage</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="ListParagraph-TableGrid-BR DocDefaults " style="position: relative; margin-left: 0in;"><span class="" style="font-family: 'Liberation Sans';">xlsx</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="ListParagraph-TableGrid-BR DocDefaults " style="position: relative; margin-left: 0in;"><span class="" style="font-family: 'Liberation Sans';">org.docx4j.openpackaging.packages.</span><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'Liberation Sans';">SpreadsheetMLPackage</span></p></td></tr></tbody></table>
  
  <p class="ListParagraph Normal DocDefaults "> </p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">and is responsible for unzipping the file into a set of objects inheriting from Part;  </span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;"><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'DejaVu Sans Mono Bold';">openpackaging</span><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">also includes functionalitiy </span><span class="" style="font-family: 'Liberation Sans';">allowing parts to be added/deleted; saving the docx/pptx/xlsx etc</span><br /><span class="" style="font-family: 'Liberation Sans';" /><br /><span class="" style="font-family: 'Liberation Sans';" /><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">This layer is based originally on OpenXML4J (which is also used by Apache POI). </span><br /><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;" /></p><ol>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">Parts are generally subclasses of </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #000000;;font-family: 'DejaVu Sans Mono Bold';">org</span><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'DejaVu Sans Mono Bold';">.docx4j.</span><span class="DefaultParagraphFont " style="font-weight: bold;color: #000000;;font-family: 'DejaVu Sans Mono Bold';">openpackaging</span><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'DejaVu Sans Mono Bold';">.parts.JaxbXmlPart</span><br /><br /><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">This (the </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #000000;;font-family: 'Liberation Sans';">jaxb</span><span class="DefaultParagraphFont " style="font-weight: bold;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> content tree</span></span><span style="font-family: 'Liberation Sans';">) is the second level of the three layered model.</span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">   </span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">To explore these first two layers for a given document, </span><a href="http://webapp.docx4java.org/OnlineDemo/PartsList.html"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">upload it to the PartsList webapp</span></a><span style="font-family: 'Liberation Sans';">.</span><br /><br /><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">Parts are arranged in a tree.  If a part has descendants, it will have a </span><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.openpackaging.parts.relationships.RelationshipsPart</span><span style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">which identifies those descendant parts.  </span><br /><br /><span style="font-family: 'Liberation Sans';">A JaxbXmlPart has a content tree:</span><br /><br /><span class="DefaultParagraphFont " style="font-size: 9.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">public Object getJaxbElement() {</span></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;">   </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">return jaxbElement;</span></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">}</span></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">public void setJaxbElement(Object jaxbElement) {</span></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;">   </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">this.jaxbElement = jaxbElement;</span></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">}</span></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /></span></li></ol>
  
  <p class="ListParagraph Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Most parts (including MainDocumentPart, styles, headers/footers, comments, </span><span class="DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';">endnotes</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">/footnotes) use </span><a href="http://dev.plutext.org/trac/docx4j/trac/docx4j/browser/trunk/docx4j/src/main/java/org/docx4j/wml"><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.wml</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;" /><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">(WordprocessingML); </span><span class="DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';">wml</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> references </span><a href="http://dev.plutext.org/trac/docx4j/trac/docx4j/browser/trunk/docx4j/src/main/java/org/docx4j/wml"><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.dml</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;" /><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="" style="font-family: 'Liberation Sans';">(DrawingML) as necessary.</span><br /><span class="" style="font-family: 'Liberation Sans';" /><br /><span class="" style="font-family: 'Liberation Sans';">These classes were generated from the Open XML schemas</span><br /><span class="" style="font-family: 'Liberation Sans';" /></p><ol>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.model</span><span class="DefaultParagraphFont " style="font-weight: bold;"><br /></span><span class="DefaultParagraphFont " style="font-weight: bold;"><br /></span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">This package builds on the lower two layers to provide extra functionality, and is being progressively further developed.    </span></li></ol>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997731" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Jaxb: marshalling and unmarshalling</span><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';white-space:pre-wrap;"> </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Docx4j contains a class representing each part.  For example, there is a </span><span class="DefaultParagraphFont " style="font-family: 'DejaVu Sans Mono Bold';">MainDocumentPart</span><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">class.  XML parts inherit from </span><span class="DefaultParagraphFont " style="font-family: 'DejaVu Sans Mono Bold';">JaxbXmlPart</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">, which contains a member called </span><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'DejaVu Sans Mono Bold';">jaxbElement</span><span class="" style="font-family: 'Liberation Sans';">.  When you want to work with the contents of a part, you work with its jaxbElement</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> by using the </span><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'DejaVu Sans Mono Bold';">get|setContents</span><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">method</span><span class="" style="font-family: 'Liberation Sans';">.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">When you open a docx document using docx4j, docx4j automatically </span><span class="DefaultParagraphFont " style="font-weight: bold;font-style: italic;;font-family: 'Liberation Sans';">unmarshals</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> the contents of each XML part to a strongly-type Java object tree (the jaxbElement).  Actually, docx4j 3.0 is lazy;  it only does this when first needed.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Similarly, if/when you tell docx4j to save these Java objects as a docx, docx4j automatically </span><span class="DefaultParagraphFont " style="font-weight: bold;font-style: italic;;font-family: 'Liberation Sans';">marshals</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> the jaxbElement in each Part.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Sometimes you will want to marshal or unmarshal things yourself.  The class </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.jaxb.Context</span><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">defines all t</span><span class="" style="font-family: 'Liberation Sans';">he JAXBContexts used in docx4j.  Here is representative (non-exhaustive) content:</span></p>
  
  <table class="TableGrid TableNormal " id="docx4j_tbl_1" style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;position: relative; margin-left: 0.76in;table-layout: fixed;vertical-align: top;border-collapse: collapse;width: 4.94in;"><colgroup><col style="width: 40.51%;" /><col style="width: 59.49%;" /></colgroup><tbody><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;vertical-align: middle;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">Jc</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.wml</span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 9.0pt;"><br /><span class="" style="font-family: 'DejaVu Sans Mono Bold';">org.docx4j.dml</span><br /><span class="" style="font-family: 'DejaVu Sans Mono Bold';">org.docx4j.dml.picture</span><br /><span class="" style="font-family: 'DejaVu Sans Mono Bold';">org.docx4j.dml.wordprocessingDrawing</span><br /><span class="" style="font-family: 'DejaVu Sans Mono Bold';">org.docx4j.vml</span><br /><span class="" style="font-family: 'DejaVu Sans Mono Bold';">org.docx4j.vml.officedrawing</span><br /><span class="" style="font-family: 'DejaVu Sans Mono Bold';">org.docx4j.math</span></span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;vertical-align: middle;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">jcThemePart</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.dml</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;vertical-align: middle;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">jcDocPropsCore</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.docProps.core</span></p>
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.docProps.core.dc.elements</span></p>
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.docProps.core.dc.terms</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;vertical-align: middle;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">jcDocPropsCustom</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.docProps.custom</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;vertical-align: middle;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">jcDocPropsExtended</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.docProps.extended</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;vertical-align: middle;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">jcXmlPackage</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.xmlPackage</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;vertical-align: middle;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">jcRelationships</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.relationships</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;vertical-align: middle;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">jcCustomXmlProperties</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.customXmlProperties</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;vertical-align: middle;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">jcContentTypes</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.openpackaging.contenttype</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;vertical-align: middle;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">jcPML</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.pml</span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 9.0pt;"><br /><span class="" style="font-family: 'DejaVu Sans Mono Bold';">org.docx4j.dml</span><br /><span class="" style="font-family: 'DejaVu Sans Mono Bold';">org.docx4j.dml.picture</span></span></p></td></tr></tbody></table>
  
  <p class="Normal DocDefaults "> </p>
  
  <p class="Normal DocDefaults " style="border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-color: #FFFF00; border-style:solid; border-width:1px;background-color: #FFFF00;"><span class="DefaultParagraphFont " style=""><span class="" style="font-family: 'Liberation Sans';">You</span><span class="" style="">’</span><span class="" style="font-family: 'Liberation Sans';">ll find XmlUtils.marshalToString very useful as you put your code together.  With this, you can easily output the content of a JAXB object, to see what XML it represents.</span></span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997732" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Parts List</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">To get a better understanding of how docx4j works </span><span class="" style="">– </span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">and the structure of a docx document </span><span class="" style="">– </span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">you can run the PartsList sample on a docx (or a pptx or xlsx).  If you do, it will list the hierarchy of parts used in that package.  It will tell you which class is used to represent each part, and where that part is a JaxbXmlPart, it will also tell you what class the </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">jaxbElement </span><span class="" style="font-family: 'Liberation Sans';">is.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">So it</span><span class="" style="">’</span><span class="" style="font-family: 'Liberation Sans';">s a bit like unzipping the docx/pptx/xlsx file, but it tells you what Java objects are being used for each part.</span></p>
  
  <table class="TableGrid TableNormal " id="docx4j_tbl_2" style="background-color: #FFFF00;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;position: relative; margin-left: 0in;table-layout: fixed;vertical-align: top;border-collapse: collapse;width: 6.65in;"><colgroup><col style="width: 100%;" /></colgroup><tbody><tr><td style="background-color: #FFFF00;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">A more fully featured tool is </span><a href="http://webapp.docx4java.org/OnlineDemo/PartsList.html"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">the PartsList online webapp</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;" /><span class="" style="font-family: 'Liberation Sans';">.  With this, you can:</span></p><ul>
  
  <li class="ListParagraph-TableGrid-BR DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">browse through the package, </span></li>
  
  <li class="ListParagraph-TableGrid-BR DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">look up what elements mean in the spec, and </span></li>
  
  <li class="ListParagraph-TableGrid-BR DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">generate code.</span></li></ul>
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">Alternatively, you can install the </span><a href="http://www.plutext.com/dn/downloads/1441189231363/Docx4jHelper-1_0.exe"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Docx4j Helper Word AddIn</span></a><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">, to generate code from within Word.  See also forum </span><a href="http://www.docx4java.org/forums/docx4jhelper-addin-f30/"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">http://www.docx4java.org/forums/docx4jhelper-addin-f30/</span></a><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;" /></p></td></tr></tbody></table>
  
  <p class="Normal DocDefaults "> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">You can run PartsList locally</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> from a command line:</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 1in;text-indent: -0.5in;"><span class="apple-style-span DefaultParagraphFont " style="color: #000000;font-size: 6.5pt;;font-family: 'Liberation Mono';">java -cp docx4j-3.0.1.jar:log4j-1.2.17.jar;</span><span class="DefaultParagraphFont " style="color: #222222;background-color: #FFFFFF;font-size: 6.5pt;;font-family: 'Liberation Mono';">slf4j-api-1.7.5.jar;slf4j-log4j12-1.7.5.jar</span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;font-size: 6.5pt;;font-family: 'Liberation Mono';white-space:pre-wrap;"> </span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;font-size: 6.5pt;"><br /><span class="" style="font-family: 'Liberation Mono';">org.docx4j.samples.</span></span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;font-size: 6.5pt;;font-family: 'Liberation Mono';white-space:pre-wrap;"> </span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;font-size: 6.5pt;;font-family: 'Liberation Mono';">PartsList [input.docx]</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">though I always find it easier to run it from my IDE.   Example</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> output: </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">Part /_rels/.rels [org.docx4j.openpackaging.parts.relationships.RelationshipsPart]</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><br /><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  containing JaxbElement:org.docx4j.relationships.Relationships</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">Part /docProps/app.xml [org.docx4j.openpackaging.parts.DocPropsExtendedPart]  </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><br /><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  containing JaxbElement:org.docx4j.docProps.extended.Properties</span></span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">Part /docProps/core.xml [org.docx4j.openpackaging.parts.DocPropsCorePart]  </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><br /><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  containing JaxbElement:org.docx4j.docProps.core.CoreProperties</span></span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">Part </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">/word/document.xml</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> [org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart]  </span><br /><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  containing JaxbElement:org.docx4j.wml.Document</span></span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 1in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">Part /word/settings.xml [</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 7.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.openpackaging.parts.WordprocessingML</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">.DocumentSettingsPart]  </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><br /><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  containing JaxbElement:org.docx4j.wml.CTSettings</span></span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 1in;margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 1in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">Part /word/styles.xml [</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 7.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.openpackaging.parts.WordprocessingML</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">.StyleDefinitionsPart]  </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><br /><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  containing JaxbElement:org.docx4j.wml.Styles</span></span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 1in;margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 1in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">Part /word/media/image1.jpeg [</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 7.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.openpackaging.parts.WordprocessingML</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">.ImageJpegPart] </span></p>
  
  <p class="Normal DocDefaults "> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">docx4j includes convenience methods to make it easy to access commonly used parts. These include,</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">on the package:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'Liberation Mono';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> MainDocumentPart getMainDocumentPart() </span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'Liberation Mono';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> DocPropsCorePart getDocPropsCorePart() </span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'Liberation Mono';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> DocPropsExtendedPart getDocPropsExtendedPart() </span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'Liberation Mono';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> DocPropsCustomPart getDocPropsCustomPart() </span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">on the document part:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'Liberation Mono';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> StyleDefinitionsPart getStyleDefinitionsPart()</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'Liberation Mono';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> NumberingDefinitionsPart getNumberingDefinitionsPart()</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'Liberation Mono';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> ThemePart getThemePart()</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'Liberation Mono';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> FontTablePart getFontTablePart()</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'Liberation Mono';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> CommentsPart getCommentsPart()</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'Liberation Mono';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> EndnotesPart getEndNotesPart()</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'Liberation Mono';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> FootnotesPart getFootnotesPart()</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'Liberation Mono';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> DocumentSettingsPart getDocumentSettingsPart()</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'Liberation Mono';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> WebSettingsPart getWebSettingsPart()</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">If a part points to any other parts, it will have a relationships part listing these other parts. </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   <span class="" style="font-family: 'Liberation Mono';">RelationshipsPart rp = part.getRelationshipsPart();</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">You can access those, and from there, get the part you want:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'Liberation Mono';">for</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> ( Relationship r : rp.getRelationships().getRelationship() ) {</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">         </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">      </span><span class="DefaultParagraphFont " style="color: #0000C0;font-style: italic;font-size: 8.0pt;;font-family: 'Liberation Mono';">log</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'Liberation Mono';">.info(</span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'Liberation Mono';">"\nFor Relationship Id="</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> + r.getId() </span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">            <span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;">+ </span></span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'Liberation Mono';">" Source is "</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> + rp.getSourceP().getPartName() </span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">            <span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;">+ </span></span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'Liberation Mono';">", Target is "</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> + r.getTarget() </span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">            <span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;">+ </span></span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'Liberation Mono';">" type "</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> + r.getType() + </span></span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'Liberation Mono';">"\n"</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'Liberation Mono';">);</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">      </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">      <span class="" style="font-family: 'Liberation Mono';">Part part = rp.getPart(r);</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   <span class="" style="font-family: 'Liberation Mono';">}</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">         </span></p>
  
  <p class="Normal DocDefaults "> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">That gives access to just the parts this part points to.</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'Liberation Mono';white-space:pre-wrap;">RelationshipsPart </span><span class="" style="font-family: 'Liberation Sans';">contains</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> various useful utility methods, for example</span><span class="" style="font-family: 'Liberation Sans';">:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">   </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">/** Gets a loaded Part by its id */</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">   </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> Part </span></span><span class="DefaultParagraphFont " style="color: #000000;background-color: #D3D3D3;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">getPart</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">(String id) </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">   </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> Part getPart(Relationship r ) {</span></span></p>
  
  <p class="Normal DocDefaults "> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">The  </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'Liberation Mono';white-space:pre-wrap;">RelationshipsPart </span><span class="" style="font-family: 'Liberation Sans';">is the key player when it comes to adding/removing images and other parts from your document.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">There is also a list of </span><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'Liberation Sans';">all</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> parts, in the package object:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   <span class="" style="font-family: 'Liberation Mono';">Parts parts = wordMLPackage.getParts();</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">The Parts object encapsulates a map of parts, keyed by PartName, but you generally shouldn</span><span class="" style="">’</span><span class="" style="font-family: 'Liberation Sans';">t add/remove things here directly!</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">To add a part, see the section </span><a href="#_Ref275255216"><span style="font-family: 'Liberation Sans';">Adding a Part</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> below.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997733" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">MainDocumentPart</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">The text of the document is to be found in the main document part.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Its XML will look something like:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;</span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:document</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">xmlns:w</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">=</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">http://schemas.openxmlformats.org/wordprocessingml/2006/main</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> &gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:body</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:p</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> &gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">      &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:pPr</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">        &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:pStyle</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:val</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">=</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">Heading1</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">/&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">      &lt;/</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:pPr</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">      &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:r</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">        &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:t</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">Hello World</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;/</span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:t</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">      &lt;/</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:r</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    &lt;/</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:p</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    :</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:sectPr</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> &gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">      &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:pgSz</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:w</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">=</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">12240</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:h</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">=</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">15840</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">/&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">      &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:pgMar</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:top</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">=</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">1440</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:right</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">=</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">1440</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:bottom</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">=</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">1440</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:left</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">=</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">1440</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:header</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">=</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">708</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:footer</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">=</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">708</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:gutter</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">=</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">0</span><span class="DefaultParagraphFont " style="font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">/&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    &lt;/</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:sectPr</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  &lt;/</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:body</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;/</span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:document</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults "> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">Given:</span></p>
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">WordprocessingMLPackage wordMLPackage</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">you can access:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">   <span class="" style="font-family: 'Liberation Mono';">MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">Classically, you'd then do:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">   <span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;">org.docx4j.wml.Document wmlDocumentEl </span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">      <span class="" style="font-family: 'Liberation Mono';">= (org.docx4j.wml.Document) documentPart.getJaxbElement();</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">   <span class="" style="font-family: 'Liberation Mono';">Body body = wmlDocumentEl.getBody();</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">But </span><span class="" style="font-family: 'Liberation Sans';">you can skip some of that with:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;;font-family: 'Liberation Mono';">/**</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;">     * Convenience method to getJaxbElement().getBody().getContent()</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;">     */</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'Liberation Mono';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'Liberation Mono';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> List&lt;Object&gt; getContent() </span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">A paragraph is org.docx4j.wml.P; a paragraph is basically made up of runs of text.</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #646464;font-size: 10.0pt;;font-family: 'Liberation Mono';">@</span><span class="DefaultParagraphFont " style="color: #646464;font-size: 10.0pt;text-decoration: underline;;font-family: 'Liberation Mono';">XmlRootElement</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'Liberation Mono';white-space:pre-wrap;">(name = </span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 10.0pt;;font-family: 'Liberation Mono';">"p"</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'Liberation Mono';">)</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'Liberation Mono';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'Liberation Mono';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'Liberation Mono';">class</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> P </span></span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'Liberation Mono';">implements</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> Child, ContentAccessor</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">The </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'Liberation Mono';">ContentAccessor</span><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> </span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">interface is simply:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;;font-family: 'Liberation Mono';">/**</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> * </span></span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F9FBF;font-size: 10.0pt;;font-family: 'Liberation Mono';">@since</span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> 2.7</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> */</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'Liberation Mono';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'Liberation Mono';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'Liberation Mono';">interface</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'Liberation Mono';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #000000;background-color: #D3D3D3;font-size: 10.0pt;;font-family: 'Liberation Mono';">ContentAccessor</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> {</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'Liberation Mono';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'Liberation Mono';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> List&lt;Object&gt; getContent();</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">   </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'Liberation Mono';">}</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">it is implemented by a number of objects, including:</span></p>
  
  <table class="TableGrid TableNormal " id="docx4j_tbl_3" style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;position: relative; margin-left: 0.86in;table-layout: fixed;vertical-align: top;border-collapse: collapse;width: 132mm;"><colgroup><col style="width: 33.97%;" /><col style="width: 24.53%;" /><col style="width: 41.5%;" /></colgroup><tbody><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Body</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">w:body</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">document body</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">P</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">w:p</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">paragraph</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">R</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">w:r</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">run</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Tbl</span></p>
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Tr</span></p>
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Tc</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">w:tbl</span></p>
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">w:tr</span></p>
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">w:tc</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">table</span></p>
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">table row</span></p>
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">table cell</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">SdtBlock</span></p>
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">SdtRun</span></p>
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">CTSdtRow</span></p>
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">CTSdtCell</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">w:sdt</span></p>
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">w:sdt</span></p>
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">w:sdt</span></p>
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">w:sdt</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">content controls; see the method</span><span class="DefaultParagraphFont " style="color: #000000;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> </span><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;">getSdtContent()</span></span></p></td></tr></tbody></table>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">As well as </span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-bottom: 0.07in;line-height: 100%;"><span style="font-family: 'Liberation Sans';">Hdr, Ftr</span></li></ul>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.25in;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-color: #FFFF00; border-style:solid; border-width:1px;background-color: #FFFF00;"><span class="" style="font-family: 'Liberation Sans';">Content is generally stored in a plain old Java List.  So there are familiar methods for inserting content at the end of the list, or other location in it.</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">Read on for how to add text etc.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997734" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Samples</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">The </span><span class="" style="font-family: 'Liberation Sans';">modules:</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span style="font-family: 'Liberation Sans';">docx4j-samples-docx4j</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span style="font-family: 'Liberation Sans';">docx4j-samples-docx-diffx</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span style="font-family: 'Liberation Sans';">docx4j-samples-docx-export-fo</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span style="font-family: 'Liberation Sans';">docx4j-samples-pptx4j</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span style="font-family: 'Liberation Sans';">docx4j-samples-xlsx4j</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span style="font-family: 'Liberation Sans';">docx4j-samples-glox4</span></li></ul>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">contains examples of how to do things with docx4j. </span><span class="" style="font-family: 'Liberation Sans';">You can find them in the GitHub repo.</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">The docx4j samples include:</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.25in;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">Basics</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">CreateWordprocessingMLDocument</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">DisplayMainDocumentPartXml</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">OpenAndSaveRoundTripTest</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">PartsList</span></li></ul>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.25in;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">Navigating the document body</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">OpenMainDocumentAndTraverse</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">XPathQuery</span></li></ul>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.25in;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">Output/Transformation</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">ConvertOutHtml</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">ConvertOutPDF</span></li></ul>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.25in;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">Import (X)HTML</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">AltChunkXHTMLRoundTrip</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">AltChunkAddOfTypeHtml</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">ConvertIn</span><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">XHTMLDocument</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">ConvertInXHTML</span><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">Fragment</span></li></ul>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.25in;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">Image handling </span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">Image</span><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">Add</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">Image</span><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">ConvertEmbedded</span><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">ToLinked</span></li></ul>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.25in;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">Part Handling</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">PartCopy</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">PartLoadFromFileSystem</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">PartsList</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">PartsStrip</span></li></ul>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.25in;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">Document generation/document assembly using content controls</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">ContentControlsAddCustomXmlDataStoragePart</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">ContentControlsXmlEdit</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">ContentControlsApplyBinding</span><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">s</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">ContentControlBindingExtensions</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">ContentControlsPartsInfo</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">AltChunkAddOfTypeDocx</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">VariableReplace (not recommended)</span></li></ul>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.25in;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.25in;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">Specific docx features</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">BookmarkAdd</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">CommentsSample</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">HeaderFooterCreate</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">HeaderFooterList</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">HyperlinkTest</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">NumberingRestart</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">SubDocument</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">TableOfContentsAdd</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">TemplateAttach (attach your.dotx)</span></li></ul>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.25in;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">Miscellaneous</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">CompareDocuments</span><span class="DefaultParagraphFont " style="font-size: 10.0pt;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> (in </span></span><span style="font-family: 'Liberation Sans';">docx4j-samples-docx-diffx)</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">DocProps</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">Filter</span><span class="DefaultParagraphFont " style="font-size: 10.0pt;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> (remove proof errors, w:rsid)</span></span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">MergeDocx</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">UnmarshallFromTemplate</span></li></ul>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.25in;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">Flat OPC XML </span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">ConvertOutFlatOpenPackage</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">ConvertInFlatOpenPackage</span></li></ul>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"> </p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997735" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Creating a new docx</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">To create a new docx:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">// Create the package</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">// Save it</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">wordMLPackage.save(new java.io.File("helloworld.docx") );</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">That's it.  </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">There</span><span class="" style="">’</span><span class="" style="font-family: 'Liberation Sans';">s a sample you can try locally from a command line:</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 1in;text-indent: -0.5in;"><span class="apple-style-span DefaultParagraphFont " style="color: #000000;font-size: 6.5pt;;font-family: 'Liberation Mono';">java -cp docx4j-3.0.1.jar:log4j-1.2.17.jar;</span><span class="DefaultParagraphFont " style="color: #222222;background-color: #FFFFFF;font-size: 6.5pt;;font-family: 'Liberation Mono';">slf4j-api-1.7.5.jar;slf4j-log4j12-1.7.5.jar</span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;font-size: 6.5pt;;font-family: 'Liberation Mono';white-space:pre-wrap;"> </span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;font-size: 6.5pt;"><br /><span class="" style="font-family: 'Liberation Mono';">org.docx4j.samples.</span></span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;font-size: 6.5pt;;font-family: 'Liberation Mono';white-space:pre-wrap;"> </span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;font-size: 6.5pt;;font-family: 'Liberation Mono';">CreateDocx [input.docx]</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">createPackage() </span><span class="" style="font-family: 'Liberation Sans';">is a convenience method, which does:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">// Create the package</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">WordprocessingMLPackage wordMLPackage = new WordprocessingMLPackage();</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">// Create the main document part (word/document.xml)</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">MainDocumentPart wordDocumentPart = new MainDocumentPart();</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">// Create main document part content</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">ObjectFactory factory = Context.getWmlObjectFactory();</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.wml.Body body = factory .createBody();</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.wml.Document wmlDocumentEl = factory .createDocument();</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">wmlDocumentEl.setBody(body);</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">// Put the content in the part</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">wordDocumentPart.setJaxbElement(wmlDocumentEl);</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">            </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">// Add the main document part to the package relationships</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">// (creating it if necessary)</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">wmlPack.addTargetPart(wordDocumentPart);</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Ref273525601" /><a name="_Toc41997736" /><span style="font-family: 'Liberation Serif';">docx4j.properties</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Here is a sample short </span><span class="" style="font-family: 'Liberation Sans';">docx4j.properties file</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> (a complete one may be copied from </span><span class="" style="font-family: 'Liberation Sans';">docx4j-samples-resources module):</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';"># Page size: use a value from org.docx4j.model.structure.PageSizePaper enum</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';"># eg A4, LETTER</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">docx4j.PageSize=</span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">LETTER</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';"># Page size: use a value from org.docx4j.model.structure.MarginsWellKnown enum</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">docx4j.PageMargins=</span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">NORMAL</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">docx4j.PageOrientationLandscape=</span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">false</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';"># Page size: use a value from org.pptx4j.model.SlideSizesWellKnown enum</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';"># eg A4, LETTER</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">pptx4j.PageSize=</span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">LETTER</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">pptx4j.PageOrientationLandscape=</span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">false</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';"># These will be injected into docProps/app.xml</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';"># if App.Write=true</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">docx4j.App.write=</span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">true</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">docx4j.Application=</span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">docx4j</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">docx4j.AppVersion=</span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">2.7</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';"># of the form XX.YYYY where X and Y represent numerical values</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';"># These will be injected into docProps/core.xml</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">docx4j.dc.write=</span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">true</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">docx4j.dc.creator.value=</span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">docx4j</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">docx4j.dc.lastModifiedBy.value=</span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">docx4j</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">#</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">#docx4j.McPreprocessor=true</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';"># If you haven't configured log4j yourself</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';"># docx4j will autoconfigure it.  Set this to true to disable that</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">docx4j.Log4j.Configurator.disabled=</span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">false</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">The page size, margin &amp; orientation values are used when new documents are created; naturally they don't affect an existing document you open with docx4j.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">If no docx4j.properties file is found on your class path, docx4j has hard coded defaults.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997737" /><span style="font-family: 'Liberation Serif';">Adding a paragraph of text</span></p>
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">MainDocumentPart </span><span class="" style="font-family: 'Liberation Sans';">contains a method:</span></p>
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">public </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.wml.P addStyledParagraphOfText(String styleId, String text)</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">You can use that method to add a paragraph using the specified style.</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">The XML we are looking to create will be something like:</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;</span><span class="xmlmarkuptagname DefaultParagraphFont " style="color: #A31515;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">w:p </span><span class="apple-converted-space DefaultParagraphFont " style="color: #000000;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';"> </span><span class="xmlmarkupattributename DefaultParagraphFont " style="color: #FF0000;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">xmlns:w</span><span class="xmlmarkupattributevalue DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">="http://schemas.openxmlformats.org/wordprocessingml/2006/main"</span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.5pt;"><br /></span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;font-size: 8.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';">    </span></span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;</span><span class="xmlmarkuptagname DefaultParagraphFont " style="color: #A31515;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:r</span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.5pt;"><br /></span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;font-size: 8.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';">        </span></span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;</span><span class="xmlmarkuptagname DefaultParagraphFont " style="color: #A31515;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:t</span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">Hello world</span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;/</span><span class="xmlmarkuptagname DefaultParagraphFont " style="color: #A31515;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:t</span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.5pt;"><br /></span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;font-size: 8.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';">    </span></span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;/</span><span class="xmlmarkuptagname DefaultParagraphFont " style="color: #A31515;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:r</span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.5pt;"><br /></span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;/</span><span class="xmlmarkuptagname DefaultParagraphFont " style="color: #A31515;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:p</span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">addStyledParagraphOfText </span><span class="" style="font-family: 'Liberation Sans';">builds the object structure </span><span class="" style="">“</span><span class="" style="font-family: 'Liberation Sans';">the JAXB way</span><span class="" style="">”</span><span class="" style="font-family: 'Liberation Sans';">, and adds it to the document.</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">It is based on:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">   </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> org.docx4j.wml.P createParagraphOfText(String simpleText) {</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">      </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">org.docx4j.wml.ObjectFactory factory = Context.</span></span><span class="DefaultParagraphFont " style="color: #000000;font-style: italic;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">getWmlObjectFactory</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">();</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">org.docx4j.wml.P  para = factory.createP();</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">      </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">if</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> (simpleText!=</span></span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">null</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">) {</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">org.docx4j.wml.Text  t = factory.createText();</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">t.setValue(simpleText);</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">   </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">org.docx4j.wml.R  run = factory.createR();</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">run.</span></span><span class="DefaultParagraphFont " style="font-weight: bold;color: #000000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">getContent</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">().add(t); </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">// ContentAccessor</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 10.0pt;">      </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">         </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">para.</span></span><span class="DefaultParagraphFont " style="font-weight: bold;color: #000000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">getContent</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">().add(run); </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">// ContentAccessor</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">}</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">      </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">      </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">return</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> para;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">}</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 4mm;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Notice that the paragraph, the run, and indeed the Body, all implement the </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'Liberation Mono';">ContentAccessor</span><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> </span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">interface:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;;font-family: 'Liberation Mono';">/**</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> * </span></span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F9FBF;font-size: 10.0pt;;font-family: 'Liberation Mono';">@since</span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> 2.7</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> */</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'Liberation Mono';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'Liberation Mono';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'Liberation Mono';">interface</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'Liberation Mono';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #000000;background-color: #D3D3D3;font-size: 10.0pt;;font-family: 'Liberation Mono';">ContentAccessor</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> {</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'Liberation Mono';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'Liberation Mono';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> List&lt;Object&gt; getContent();</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;">   </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'Liberation Mono';">}</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">The add method adds the content at the end of the document.  If you want to insert it somewhere else, </span><span class="" style="font-family: 'Liberation Sans';">you could use something like:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> org.docx4j.wml.P addParaAtIndex(MainDocumentPart mdp,</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">String simpleText, </span></span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">int</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> index) {</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">org.docx4j.wml.ObjectFactory factory = Context.</span></span><span class="DefaultParagraphFont " style="color: #000000;font-style: italic;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">getWmlObjectFactory</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">();</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">org.docx4j.wml.P para = factory.createP();</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">      </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">if</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> (simpleText != </span></span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">null</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">) {</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">org.docx4j.wml.Text t = factory.createText();</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">t.setValue(simpleText);</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">org.docx4j.wml.R run = factory.createR();</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">run.getContent().add(t);</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">para.getContent().add(run);</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">}</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">mdp.getContent().add(index, para);</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">      </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">return</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> para;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">}</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">Alternatively, you can create the paragraph by marshalling XML:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">// Assuming String xml contains the XML above</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.wml.P  para = XmlUtils.unmarshalString(xml);</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">For this to work, you need to ensure that all namespaces are declared properly in the string.</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">See further below for adding images, and tables.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Ref273526076" /><a name="_Toc41997738" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">General strategy/approach for creating stuff</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">The first thing you need to know is what the XML you are trying to create looks like.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">To figure this out, start with a docx that contains the construct (create it in Word if necessary).</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Now look at its XML. Choices:</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">You can unzip it to do this </span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;"> </span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">blagh</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">upload it to </span><a href="http://webapp.docx4java.org/OnlineDemo/PartsList.html"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">the PartsList </span><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">online </span><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">webapp</span></a><span style="font-family: 'Liberation Sans';white-space:pre-wrap;"> </span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">(which can also generate code for you)</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">save it as Flat OPC XML from Word (or use the </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Mono';">ExportInPackageFormat</span><span style="font-family: 'Liberation Mono';white-space:pre-wrap;"> </span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">sample),  so you have just a single XML file which you don't need to unzip</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">you can use the </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Mono';white-space:pre-wrap;">DisplayMainDocumentPartXml </span><span class="DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';">to get it</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span class="DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';">you can open it with docx4all, and look at the source view</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span class="DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';">on Windows, if you have Visual Studio 2010, you can drag the docx onto it</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span class="DefaultParagraphFont " style="color: #000000;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">if you use Google</span><span class="" style="">’</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">s Chrome web browser, try </span></span><a href="https://chrome.google.com/webstore/detail/ooxml-viewer/bjmmjfdegplhkefakjkccocjanekbapn"><span class="Hyperlink DefaultParagraphFont " style="font-weight: bold;color: #0066DD;background-color: #F7F7F7;font-size: 9.0pt;;font-family: 'Liberation Sans';">OOXML Viewer for Chrome</span></a><span class="DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';">.</span></li></ul>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Now you are ready to create this XML using JAXB.  There are 2 basic ways.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">The classic JAXB way is to use the ObjectFactory's .createX methods.  For example:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">       </span><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;">ObjectFactory factory = Context.</span></span><span class="DefaultParagraphFont " style="color: #000000;font-style: italic;font-size: 9.0pt;;font-family: 'Liberation Mono';">getWmlObjectFactory</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Mono';white-space:pre-wrap;">(); </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;">       P p = factory.createP();</span>   </span></p>
  
  <p class="Normal DocDefaults "> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">The challenge with this is to know what object it is you are trying to create.  To find this out, the easiest way by far is to use </span><a href="http://webapp.docx4java.org/OnlineDemo/PartsList.html"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">the PartsList </span><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">online </span><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">webapp</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">.  Alternatively, you could run </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Mono';white-space:pre-wrap;">OpenMainDocumentAndTraverse </span><span class="" style="font-family: 'Liberation Sans';">on your document, or use Eclipse to search the relevant schema (in /xsd) or source code.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Here are the names for some common objects:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <table class="TableGrid TableNormal " id="docx4j_tbl_4" style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;position: relative; margin-left: 0.37in;table-layout: fixed;vertical-align: top;border-collapse: collapse;width: 5.12in;"><colgroup><col style="width: 19.22%;" /><col style="width: 17.31%;" /><col style="width: 32.36%;" /><col style="width: 31.11%;" /></colgroup><tbody><tr><td style="background-color: #D9D9D9;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="font-weight: bold;color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">Object</span></p></td><td style="background-color: #D9D9D9;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="font-weight: bold;color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">XML element</span></p></td><td style="background-color: #D9D9D9;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="font-weight: bold;color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">docx4j class</span></p></td><td style="background-color: #D9D9D9;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="font-weight: bold;color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">Factory method</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">Document body</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">w:body</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">org.docx4j.wml.Body</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">factory.createBody();</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">Paragraph</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">w:p</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">org.docx4j.wml.P</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">factory.createP()</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">Paragraph props</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">w:pPr</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">org.docx4j.wml.PPr</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">factory.createPPr()</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">Run</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">w:r</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">org.docx4j.wml.R</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">factory.createR()</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">Run props</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">w:rPr</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">org.docx4j.wml.RPr</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">factory.createRPr()</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">Text</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">w:t</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">org.docx4j.wml.Text</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">factory.createText()</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">Table</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">w:tbl</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">org.docx4j.wml.Tbl</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">factory.createTbl()</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">Table row</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">w:tr</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">org.docx4j.wml.Tr</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">factory.createTr()</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">Table cell</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">w:tc</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">org.docx4j.wml.Tc</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">factory.createTc()</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">Drawing</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">w:drawing</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">org.docx4j.wml.Drawing</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">factory.createDrawing()</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">Page break</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">w:br</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">org.docx4j.wml.Br</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">factory.createBr()</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">Footnote </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;"><br /><span class="" style="font-family: 'Liberation Sans';">or endnote ref</span></span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">?</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">org.docx4j.wml.CTFtnEdnRef</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'Liberation Sans';">factory.createCTFtnEdnRef()</span></p></td></tr></tbody></table>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">An easier way to create stuff </span><span class="" style="font-family: 'Liberation Sans';">may be to just unmarshal the  XML (eg a String representing a paragraph to be inserted into the document).</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">For example, given:</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;</span><span class="xmlmarkuptagname DefaultParagraphFont " style="color: #A31515;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">w:p </span><span class="apple-converted-space DefaultParagraphFont " style="color: #000000;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';"> </span><span class="xmlmarkupattributename DefaultParagraphFont " style="color: #FF0000;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">xmlns:w</span><span class="xmlmarkupattributevalue DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">="http://schemas.openxmlformats.org/wordprocessingml/2006/main"</span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.5pt;"><br /></span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;font-size: 8.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';">    </span></span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;</span><span class="xmlmarkuptagname DefaultParagraphFont " style="color: #A31515;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:r</span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.5pt;"><br /></span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;font-size: 8.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';">        </span></span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;</span><span class="xmlmarkuptagname DefaultParagraphFont " style="color: #A31515;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:t</span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">Hello world</span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;/</span><span class="xmlmarkuptagname DefaultParagraphFont " style="color: #A31515;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:t</span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.5pt;"><br /></span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;font-size: 8.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';">    </span></span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;/</span><span class="xmlmarkuptagname DefaultParagraphFont " style="color: #A31515;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:r</span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.5pt;"><br /></span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;/</span><span class="xmlmarkuptagname DefaultParagraphFont " style="color: #A31515;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:p</span><span class="xmlmarkupbracket DefaultParagraphFont " style="color: #0000FF;font-size: 8.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">you can simply:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">// Assuming String xml contains the XML above</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.wml.P  para = XmlUtils.unmarshalString(xml);</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-color: #FFFF00; border-style:solid; border-width:1px;background-color: #FFFF00;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">The </span><a href="http://webapp.docx4java.org/OnlineDemo/PartsList.html"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">PartsList </span><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">online </span><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">webapp</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> can generate appropriate code for you, using both of these approaches.  It also links to the Open XML spec documentation for the element.</span></p>
  
  <p class="Normal DocDefaults " style="border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-color: #FFFF00; border-style:solid; border-width:1px;background-color: #FFFF00;"><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">Alternatively, you can install the </span><a href="http://www.plutext.com/dn/downloads/1441189231363/Docx4jHelper-1_0.exe"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">Docx4j Helper Word AddIn</span></a><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">, to generate code from within Word.  See also forum </span><a href="http://www.docx4java.org/forums/docx4jhelper-addin-f30/"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">http://www.docx4java.org/forums/docx4jhelper-addin-f30/</span></a><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;" /></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">If you need to be explicit about the type, you can use:</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">public static </span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">Object unmarshalString(String str, JAXBContext jc, Class declaredType)</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997739" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Formatting Properties</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Usually you format the appearance of things via an object</span><span class="" style="">’</span><span class="" style="font-family: 'Liberation Sans';">s properties element:</span></p>
  
  <table class="TableGrid TableNormal " id="docx4j_tbl_5" style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;position: relative; margin-left: 0.47in;table-layout: fixed;vertical-align: top;border-collapse: collapse;width: 101mm;"><colgroup><col style="width: 44.09%;" /><col style="width: 55.91%;" /></colgroup><tbody><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Object</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Method</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Paragraph</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">P.getPPr()</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Run</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">R.getRPr()</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Table</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Tbl.getTblPr()</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Table row</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Tr.getTrPr()</span></p></td></tr><tr><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Table cell</span></p></td><td style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0mm;padding-left: 1.91mm;padding-right: 1.91mm;padding-top: 0mm;">
  
  <p class="Normal-TableGrid-BR DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Tc.getTcPr()</span></p></td></tr></tbody></table>
  
  <p class="Normal DocDefaults "> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">In a docx, the appearance of text is basically determined by the style in the styles part which applies to it (styles can inherit from other styles), plus any direct formatting.  </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Docx4j contains code for working out the effective formatting, which is used in its PDF output.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">In XHTML import, docx4j converts CSS into formatting properties.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997740" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Creating and adding a table</span></p>
  
  <p class="Normal DocDefaults "><a href="http://dev.plutext.org/trac/docx4j/browser/trunk/docx4j/src/main/java/org/docx4j/model/table/TblFactory.java"><span style="font-family: 'Liberation Sans';">org.docx4j.model.table.TblFactory</span></a><span style="font-family: 'Liberation Sans';white-space:pre-wrap;"> </span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">provides an easy way to create a simple table. For an example of its use, see the </span><a href="http://dev.plutext.org/trac/docx4j/browser/trunk/docx4j/src/main/java/org/docx4j/samples/CreateWordprocessingMLDocument.java"><span style="font-family: 'Liberation Sans';">CreateWordprocessingMLDocument sample</span></a><span style="font-family: 'Liberation Sans';">.</span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">  </span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">If you want to add </span><span style="font-family: 'Liberation Sans';">content</span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">, see </span><a href="#_Ref273526076"><span class="DefaultParagraphFont " style="font-weight: bold;font-style: italic;;font-family: 'Liberation Sans';">General strategy/approach for creating stuff</span></a><span style="font-family: 'Liberation Sans';white-space:pre-wrap;"> </span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">above.</span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">  </span><span style="font-family: 'Liberation Sans';">If you want format your table (make it prettier), see Formatting Properties immediately above.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Or you can use the </span><a href="http://webapp.docx4java.org/OnlineDemo/PartsList.html"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">PartsList </span><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">online </span><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">webapp</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> to generate the code.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">If you are looking to fill table rows with data, consider OpenDoPE content control data binding (in which you </span><span class="" style="">“</span><span class="" style="font-family: 'Liberation Sans';">repeat</span><span class="" style="">” </span><span class="" style="font-family: 'Liberation Sans';">a table row).</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997741" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';white-space:pre-wrap;">Selecting your insertion/editing point; </span><span class="DefaultParagraphFont "><br /><span class="" style="font-family: 'Liberation Serif';">accessing JAXB nodes via XPath</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">Sometimes, XPath is a succinct way to select the things you need to change.</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">You</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> can use XPath to select JAXB nodes:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">String xpath = </span></span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">"//w:p"</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">;</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">      </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">List&lt;Object&gt; list = documentPart.getJAXBNodesViaXPath(xpath, </span></span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">false</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">);</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">These JAXB nodes are live, in the sense that if you change them, your document changes.</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">There are a few limitations however</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> in the JAXB reference implementation: </span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">the xpath expressions are evaluated against the XML document as it was when first opened in docx4j.  You can update the associated XML document once only, by passing true into </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">getJAXBNodesViaXPath</span><span style="font-family: 'Liberation Sans';">. Updating it again (with current JAXB 2.1.x or 2.2.x) will cause an error.</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span style="font-family: 'Liberation Sans';">For some document</span><span style="font-family: 'Liberation Sans';">s</span><span style="font-family: 'Liberation Sans';">, JAXB can</span><span>’</span><span style="font-family: 'Liberation Sans';">t set up the XPath</span></li></ul>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">If these limitations are causing you problems, try using MOXy as your JAXB implementation, or see Traversing immediately </span><span class="" style="font-family: 'Liberation Sans';">below for a different approach.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997742" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Traversing a document</span></p>
  
  <p class="Normal DocDefaults "><a href="https://github.com/plutext/docx4j/blob/master/src/main/java/org/docx4j/samples/OpenMainDocumentAndTraverse.java"><span class="DefaultParagraphFont " style="color: #0000FF;text-decoration: underline;;font-family: 'Liberation Sans';">OpenMainDocumentAndTraverse.java</span></a><span style="font-family: 'Liberation Sans';white-space:pre-wrap;"> </span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">in the samples directory shows you how to traverse the JAXB representation of a docx.  </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">This is an alternative to XSLT, which doesn't require marshalling</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> to a DOM document and </span><span class="" style="font-family: 'Liberation Sans';">unmarshalling</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> again</span><span class="" style="font-family: 'Liberation Sans';">.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">The sample uses TraversalUtil, which is a general approach for traversing the JAXB object tree in the main document part.  It can also be applied to headers, footers etc.   TraversalUtil has an </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">interface</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> Callback, </span></span><span class="" style="font-family: 'Liberation Sans';">which you use to specify how you want to traverse the nodes, and what you want to do to them.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">As noted earlier,</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> many objects (eg the document body, a paragraph, a run), have a List containing their content.  Traversal works by iterating over these lists. </span></p>
  
  <p class="Normal DocDefaults " style="border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-color: #FFFF00; border-style:solid; border-width:1px;background-color: #FFFF00;"><span class="DefaultParagraphFont " style="background-color: #FFFF00;;font-family: 'Liberation Sans';">Traversing is a very useful approach</span><span class="DefaultParagraphFont " style="background-color: #FFFF00;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> for finding and altering parts of the document.</span></span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">  </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">For example, it is used in docx4j 2.8.0, to provide a way of producing HTML output without using XSLT/Xalan.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">The </span><a href="https://github.com/plutext/docx4j/tree/master/src/main/java/org/docx4j/finders"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">org.docx4j.finders</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> package contains classes which make it convenient to find various objects.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">It is often superior to using XPath (owing to the limitations in the JAXB reference implementation noted above).</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Note also, in </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">package</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> org.docx4j.utils:</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">/** </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> * Use this if there is only a single object type (</span></span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">eg</span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> just P's)</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> * you are interested in doing something with.</span></span></p>
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">class</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> SingleTraversalUtilVisitorCallback </span></span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">ImageConvertEmbeddedToLinked sample contains an example of the use of the above.</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">/** </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> * Use this if there is more than one object type (</span></span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">eg</span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> Tables and Paragraphs)</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 10.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> * you are interested in doing something with during the traversal.</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">class</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> CompoundTraversalUtilVisitorCallback </span></span></p>
  
  <p class="Normal DocDefaults "> </p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Ref275255216" /><a name="_Toc41997743" /><span style="font-family: 'Liberation Serif';">Adding a Part</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">What if you wanted to add a new styles part? Here's how:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">// Create a styles part</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">StyleDefinitionsPart stylesPart = </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">new </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">StyleDefinitionsPart();</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">// Populate it with default styles</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">stylesPart.unmarshalDefaultStyles();</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">      </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">// Add the styles part to the main document part relationships</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">wordDocumentPart.addTargetPart(stylesPart);</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">You'd take the same approach to add a header or footer.</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">When you add a part this way, it is automatically added to the source part's relationships part.</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">Generally, you'll also need to add a reference to the part (using its relationship id) to the Main Document Part.  This applies to images, headers and footers. (Comments, footnotes and endnotes are a bit different, in that what you add to the main document part are references to individual comments/footnotes/endnotes).</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997744" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Importing XHTML</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">docx4j can convert XHTML content (paragraphs, tables, images) into native WordML, reproducing much of the formatting.</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">  </span></p>
  
  <p class="NormalWeb Normal DocDefaults " style="border-color: #FFFFFF; border-style:solid; border-width:1px;background-color: #FFFFFF;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';">From v3, the XHTML Import functionality is a</span><span class="apple-converted-space DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';"> </span><a href="https://github.com/plutext/docx4j-ImportXHTML"><span class="Hyperlink DefaultParagraphFont " style="color: #B85B5A;font-size: 11.0pt;;font-family: 'Liberation Sans';">separate project on GitHub</span></a><span class="apple-converted-space DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';" /><span class="DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';">.</span></p>
  
  <p class="NormalWeb Normal DocDefaults " style="border-color: #FFFFFF; border-style:solid; border-width:1px;background-color: #FFFFFF;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';">The reason being that its main dependency – Flying Saucer - is licensed under LGPL v2.1 (as opposed to ASL v2, which docx4j’s other dependencies use).</span></p>
  
  <p class="NormalWeb Normal DocDefaults " style="border-color: #FFFFFF; border-style:solid; border-width:1px;background-color: #FFFFFF;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';">If you want this functionality, you have to add these jars to your classpath.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">See the samples at </span><a href="https://github.com/plutext/docx4j-ImportXHTML/tree/master/src/samples"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">https://github.com/plutext/docx4j-ImportXHTML/tree/master/src/samples</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;" /></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997745" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">docx to (X)HTML</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">docx4j can convert a docx to HTML or XHTML.  </span><span class="" style="font-family: 'Liberation Sans';">You will find the generated HTML is clean</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> (in comparison to the HTML Word produces)</span><span class="" style="font-family: 'Liberation Sans';">.</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">Docx4j</span><span class="" style="">’</span><span class="" style="font-family: 'Liberation Sans';">s HTML output is suitable for documents which contain paragraphs, tables and images.  It can</span><span class="" style="">’</span><span class="" style="font-family: 'Liberation Sans';">t handle more exotic features, such as equations, SmartArt, or WordArt (DrawingML or VML).</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">Elsewhere on the web, you</span><span class="" style="">’</span><span class="" style="font-family: 'Liberation Sans';">ll find XSLT which can convert docx to HTML.  That XSLT is very complex, since it has to derive effective formatting from the hierarchy.</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">In contrast, in docx4j, that logic is implemented in Java.  Because of this, docx4j</span><span class="" style="">’</span><span class="" style="font-family: 'Liberation Sans';">s XSLT is simple (Java XSLT extension functions do the heavy lifting).</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">In docx4j, you can create output using XSLT, or by traversing the document in Java.</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">  The façade lets you specify which:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">      </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">//Prefer the exporter, that uses a </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">xsl</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> transformation</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">Docx4J.</span></span><span class="DefaultParagraphFont " style="color: #000000;font-style: italic;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">toHTML</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">(htmlSettings, os, Docx4J.</span><span class="DefaultParagraphFont " style="color: #0000C0;font-style: italic;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">FLAG_EXPORT_PREFER_XSL</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">);</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">      </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">//Prefer the exporter, that doesn't use a </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">xsl</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> transformation (= uses a visitor)</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">//</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">Docx4J.toHTML(htmlSettings, </span></span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">os</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">, Docx4J.FLAG_EXPORT_PREFER_NONXSL);</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">See the sample on GitHub at </span><a href="https://github.com/plutext/docx4j/blob/master/src/samples/docx4j/org/docx4j/samples/ConvertOutHtml.java"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">src/samples/docx4j/org/docx4j/samples/ConvertOutHtml.java</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;" /></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">If you have output logging enabled, anything which is not implemented will be obvious in the output document.  </span><span class="DefaultParagraphFont " style="font-weight: bold;font-style: italic;;font-family: 'Liberation Sans';">If debug level logging is not switched on, unsupported elements will be silently dropped.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997746" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">docx to PDF</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Use the Docx4J facade to convert to PDF:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">static</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">void</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> toPDF(WordprocessingMLPackage </span></span><span class="DefaultParagraphFont " style="color: #6A3E3E;background-color: #FFFF00;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">wmlPackage</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">, OutputStream </span><span class="DefaultParagraphFont " style="color: #6A3E3E;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">outputStream</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">) </span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;text-indent: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">throws</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> Docx4JException </span></span></p>
  
  <p class="Normal DocDefaults "> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Docx4j offers several ways under the covers </span><span class="" style="font-family: 'Liberation Sans';">to create a PDF from a docx.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Best results are achieved if Microsoft Word is available -locally or remotely - to perform the conversion.  If this is the case, you can put </span><span class="" style="font-family: 'Liberation Sans';">docx4j-documents4j-local</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">  or </span><span class="" style="font-family: 'Liberation Sans';">docx4j-documents4j-remote</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> on your classpath</span><span class="" style="font-family: 'Liberation Sans';">, and rely on Microsoft Word to do the conversion.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">If Word is not available, you can generate PDF output via XSL FO using FOP.  If you want to use the existing XSL FO + Apache FOP PDF Conversion, just add docx4j-export-fo (+ deps) to your classpath.  If docx4j detects that they are present, it will revert to </span><span class="" style="font-family: 'Liberation Sans';">this</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> FO based conversion.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">These jars are in the zip file, in dir optional/export-fo  </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Note: For a period to 2019, Plutext offered a commercial PDF Converter.  That product is no longer available.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997747" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Image Handling</span><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';white-space:pre-wrap;"> - DOCX</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">When you add an image to a document in Word 2007, it is generally added as a new Part (ie you'll find a part in the resulting docx, containing the image in base 64 format).</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">When you open the document in docx4j, docx4j will create an image part representing it.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">It is also possible to create a </span><span class="" style="">“</span><span class="" style="font-family: 'Liberation Sans';">linked</span><span class="" style="">” </span><span class="" style="font-family: 'Liberation Sans';">image.  In this case, the image is not embedded in the docx package, but rather, is referenced at its external location.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Docx4j's </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #000000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">BinaryPartAbstractImage</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="" style="font-family: 'Liberation Sans';">class contains methods to allow you to create both embedded and linked images (along with appropriate relationships).</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">/**</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">   </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">* Create an image part from the provided byte array, attach it to the </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">   </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">* main document part, and return it.*/</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">public static </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">BinaryPartAbstractImage createImagePart(WordprocessingMLPackage wordMLPackage,</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">      </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">byte</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">[] bytes) </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">/**</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">   </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">* Create an image part from the provided byte array, attach it to the source part</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">   </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">* (eg the main document part, a header part etc), and return it.*/</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">public static </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">BinaryPartAbstractImage createImagePart(WordprocessingMLPackage wordMLPackage,</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">      </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">Part sourcePart, </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">byte</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">[] bytes) </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">/**</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">   </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">* Create a linked image part, and attach it as a rel of the specified source part</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">   </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">* (eg a header part)</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">*/</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">public static </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">BinaryPartAbstractImage createLinkedImagePart(</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;"><br /></span><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">      </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">WordprocessingMLPackage wordMLPackage, Part sourcePart, String fileurl) </span></p>
  
  <p class="Normal DocDefaults "> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">For an image to appear in the document, there also needs to be appropriate XML in the main document part.  This XML can take 2 basic forms:</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;margin-bottom: 0in;line-height: 100%;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">the Word 2007 </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #800000;;font-family: 'DejaVu Sans Mono Bold';">w:drawing</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span style="font-family: 'Liberation Sans';">form</span></li></ul>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 9.0pt;">   </span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;w:p&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;w:r&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;w:drawing&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">            <span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">&lt;wp:inline </span></span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">distT</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">="0" </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">distB</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">="0" </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">distL</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">="0" </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">distR</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">="0"</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">               <span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">&lt;wp:extent </span></span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">cx</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">="3238500" </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">cy</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">="2362200" /</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">               <span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">&lt;wp:effectExtent </span></span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">l</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">="19050" </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">t</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">="0" </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">r</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">="0" </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">b</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">="0" /</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">               <span class="" style="font-family: 'DejaVu Sans Mono Bold';">:</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">               <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;a:graphic &gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">                  <span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">&lt;a:graphicData </span></span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> ..</span></span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">                     <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;pic:pic &gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">                        <span class="" style="font-family: 'DejaVu Sans Mono Bold';">:</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">                        <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;pic:blipFill&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">                           <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;</span></span><span class="DefaultParagraphFont " style="font-weight: bold;color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">a:blip </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #FF0000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">r:embed</span><span class="DefaultParagraphFont " style="font-weight: bold;color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">="rId5"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> /</span></span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">                           <span class="" style="font-family: 'DejaVu Sans Mono Bold';">:</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">                        <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;</span></span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">pic:blipFill&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">                        <span class="" style="font-family: 'DejaVu Sans Mono Bold';">:</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">                     <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;</span></span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">pic:pic&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">                  <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;</span></span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">a:graphicData&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">               <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;</span></span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">a:graphic&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">            <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;</span></span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">wp:inline&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;</span></span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">w:drawing&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;</span></span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">w:r&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;</span></span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">w:p&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">the Word 2003 VML-based </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #800000;;font-family: 'DejaVu Sans Mono Bold';">w:pict</span><span style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">form</span></li></ul>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;">   </span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;w:p&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;w:r&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;w:pict&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">            <span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">&lt;v:shapetype </span></span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">id</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">="_x0000_t75" </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">coordsize</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">="21600,21600" </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> .. </span></span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">               <span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">&lt;v:stroke </span></span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">joinstyle</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">="miter" /</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">               <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;v:formulas&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">                  <span class="" style="font-family: 'DejaVu Sans Mono Bold';">:</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">               <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;</span></span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">v:formulas&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">               <span class="" style="font-family: 'DejaVu Sans Mono Bold';">:</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">            <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;</span></span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">v:shapetype&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">            <span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">&lt;v:shape </span></span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">..</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">style</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">="width:428.25pt;height:321pt"</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">               <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;</span></span><span class="DefaultParagraphFont " style="font-weight: bold;color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">v:imagedata </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #FF0000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">r:id</span><span class="DefaultParagraphFont " style="font-weight: bold;color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">="rId4"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">o:title</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">="" /</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;">            <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;</span></span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">v:shape&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 12.0pt;">         </span><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">w:pict&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;</span></span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">w:r&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;</span></span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">w:p&gt;</span></p>
  
  <p class="Normal DocDefaults "> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Docx4j can create the Word 2007 </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #800000;;font-family: 'DejaVu Sans Mono Bold';">w:drawing/wp:inline</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="" style="font-family: 'Liberation Sans';">form for you:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">/**</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">   </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">* Create a </span><span class="DefaultParagraphFont " style="color: #7F7F9F;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">&lt;wp:inline&gt; </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">element suitable for this image,</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">   </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">* which can be linked or embedded in w:p/w:r/w:drawing.</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">   </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">* If the image is wider than the page, it will be scaled</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">   </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">* automatically.  See Javadoc for other signatures.</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">   </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">* </span><span class="DefaultParagraphFont " style="color: #7F9FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">@param </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">filenameHint Any text, for example the original filename</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">   </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">* </span><span class="DefaultParagraphFont " style="color: #7F9FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">@param </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">altText  Like HTML's alt text</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">   </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">* </span><span class="DefaultParagraphFont " style="color: #7F9FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">@param </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">id1   An id unique in the document</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">   </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">* </span><span class="DefaultParagraphFont " style="color: #7F9FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">@param </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">id2   Another id unique in the document</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">   </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">* </span><span class="DefaultParagraphFont " style="color: #7F9FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">@param </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">link</span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  true if this is to be </span></span><span class="DefaultParagraphFont " style="font-weight: bold;color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">linked not embedded</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">*/</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">public </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">Inline createImageInline(String filenameHint, String altText, </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">      </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">int </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">id1, </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">int </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">id2, </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">boolean </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">link) </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">which you can then add to a </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #800000;;font-family: 'DejaVu Sans Mono Bold';">w:r/w:drawing.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Finally, with docx4j, you can convert images from formats unsupported by Word (eg PDF), to PNG, which is a supported format.  For this, docx4j uses </span><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'Liberation Sans';">ImageMagick</span><span class="" style="font-family: 'Liberation Sans';">.  So if you want to use this feature, you need to install ImageMagick.  Docx4j invokes ImageMagick using:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> </span><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">Process p = Runtime.getRuntime().exec(</span></span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">"imconvert -density " </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">+ density + </span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">" -units PixelsPerInch - png:-"</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">);</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><br /></span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Note the name </span><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'Liberation Sans';">imconvert</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">, which is used so that we don't have to supply a full path to exec.  You'll need to accommodate that.  </span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997748" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Manual Image Manipulation</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Images involve three things:</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">the image part itself</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">a relationship, in the relationships part of the main document part (or header part etc).  This relationship includes:</span></li><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">the name of the image part (for example, </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">/word/media/image1.jpeg</span><span style="font-family: 'Liberation Sans';">)</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">the relationship ID</span></li></ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">some XML in the main document part (or header part etc), referencing the relationship ID (see </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #800000;;font-family: 'DejaVu Sans Mono Bold';">w:drawing</span><span style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">and </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #800000;;font-family: 'DejaVu Sans Mono Bold';">w:pict</span><span style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">examples above)</span></li></ul>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">This means that if you are moving images around, you need to take care to ensure that the relationships remain valid. </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">You can manually manipulate the relationship, and you can manually manipulate the XML referencing the relationship IDs.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Given an image part, you can get the relationship pointing to it </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">      </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">Relationship </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">rel = copiedImagePart.getSourceRelationship();</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">String id = rel.getId();</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">You can then ensure the reference matches.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997749" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Image Handling – PPTX</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">See the pptx4j </span><a href="https://github.com/plutext/docx4j/blob/master/src/pptx4j/java/org/pptx4j/samples/InsertPicture.java"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">InsertPicture</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> sample.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997750" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Adding Headers/Footers</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">See the HeaderFooter sample for how to do this.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997751" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Protection Settings</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">There is a family of features the Office UI groups under </span><span class="" style="">“</span><span class="" style="font-family: 'Liberation Sans';">Protection Settings</span><span class="" style="">”</span><span class="" style="font-family: 'Liberation Sans';">. These include:</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">mark as final</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">encrypt with password</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">digital signatures</span></li></ul>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Most protection settings can be manipulated using docx4j 3.3.  It contains a class ProtectionSettings:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">/**</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> * The Protection Settings which are common across</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> * </span></span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">docx</span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">, </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">pptx</span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">, </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">xlsx</span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">, namely mark as final, encrypt with password,</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> * and digital signature.  Subclasses implement the </span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> * </span></span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">docx</span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> and </span></span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">xlsx</span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> format specific features.</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> * </span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> * </span></span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F9FBF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">@author</span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">jharrop</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> * </span></span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F9FBF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">@since</span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> 3.3.0</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> */</span></span></p>
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">abstract</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">class</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> ProtectionSettings</span></span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">The relevant subclass is accessed via the package object:</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">WordprocessingMLPackage</span><span style="font-family: 'Liberation Sans';">:</span><br /><br /><span style="font-family: 'Liberation Sans';">ProtectDocument getProtectionSettings()</span><br /></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">PresentationMLPackage</span><br /><br /><span style="font-family: 'Liberation Sans';">ProtectPresentation getProtectionSettings()</span><br /></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">SpreadsheetMLPackage</span><br /><br /><span style="font-family: 'Liberation Sans';">ProtectWorkbook getProtectionSettings()</span></li></ul>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Note: support for digital signatures is in Plutext</span><span class="" style="">’</span><span class="" style="font-family: 'Liberation Sans';">s Enterprise edition.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997752" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';white-space:pre-wrap;">docx </span><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Table of Contents</span></p>
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';">D</span><span class="DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';white-space:pre-wrap;">ocx4j (from v3.3.0) can generate/update a ToC, including update its page numbers.  </span></p>
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';">In docx4j v8.2.0, this can be done in 2 distinct ways: (1) by automating Microsoft Word using documents4j (new in v8.2.0) or, (2) in pure Java (albeit with possible inaccuracy in the page numbers).</span></p>
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';white-space:pre-wrap;">For the documents4j approach, please see </span><a href="https://github.com/plutext/docx4j/blob/VERSION_8_2_0/docx4j-samples-documents4j-local/src/main/java/org/docx4j/samples/documents4j/local/TocOperations.java"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">https://github.com/plutext/docx4j/blob/VERSION_8_2_0/docx4j-samples-documents4j-local/src/main/java/org/docx4j/samples/documents4j/local/TocOperations.java</span></a><span class="DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';white-space:pre-wrap;" /></p>
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">That example is for Word running locally.  If you run Word remotely, please see the comments at </span><a href="https://github.com/plutext/docx4j/blob/VERSION_8_2_0/docx4j-documents4j-remote/src/main/java/org/docx4j/documents4j/remote/Documents4jRemoteServices.java#L61"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">https://github.com/plutext/docx4j/blob/VERSION_8_2_0/docx4j-documents4j-remote/src/main/java/org/docx4j/documents4j/remote/Documents4jRemoteServices.java#L61</span></a><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;" /></p>
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">The "pure Java" approach uses export-fo.  For an example using this approach, please see </span><a href="https://github.com/plutext/docx4j/blob/VERSION_8_2_0/docx4j-samples-docx4j/src/main/java/org/docx4j/samples/TocSample.java"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">https://github.com/plutext/docx4j/blob/VERSION_8_2_0/docx4j-samples-docx4j/src/main/java/org/docx4j/samples/TocSample.java</span></a><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;" /></p>
  
  <p class="Heading2 Normal DocDefaults "><a name="_Toc403733683" /><a name="_Toc41997753" /><span style="font-family: 'Liberation Serif';">Introduction</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">A table of contents is often included in a docx file.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Where docx4j or other code is used to modify the document, the TOC may need updating since page numbers may be wrong, or entries added, deleted or modified.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">In some cases, it is sufficient to leave the TOC updating until the docx is opened in Microsoft Word.  In Word, the user can manually issue the command to update the table.  </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">In other scenarios, it is desirable to update the TOC programmatically.  For example, prior to PDF output.  </span><span class="" style="font-family: 'Liberation Sans';">The samples above show the 2 approaches docx4j offers for doing this.</span></p>
  
  <p class="Heading2 Normal DocDefaults "><a name="_Toc403733684" /><a name="_Toc41997754" /><span style="font-family: 'Liberation Serif';">Field background</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Historically, Word has used a </span><span class="DefaultParagraphFont " style="font-style: italic;;font-family: 'Liberation Sans';">field code</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> to specify a table of contents.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">A table of contents field is just one type of field, amongst many:</span></p>
  
  <p class="Grammar Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">date-and-time:</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">CREATEDATE</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">DATE</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">EDITTIME</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">PRINTDATE</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">SAVEDATE</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">TIME</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  </span></p>
  
  <p class="Grammar Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">document-automation:</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">COMPARE</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">DOCVARIABLE</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">GOTOBUTTON</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">IF</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">MACROBUTTON</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">PRINT</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  </span></p>
  
  <p class="Grammar Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">document-information:</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">AUTHOR</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">COMMENTS</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">DOCPROPERTY</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">FILENAME</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">FILESIZE</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">INFO</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">|  </span></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">KEYWORDS</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">LASTSAVEDBY</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">NUMCHARS</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">NUMPAGES</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">NUMWORDS</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">SUBJECT</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">|  </span></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">TEMPLATE</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">TITLE</span></p>
  
  <p class="Grammar Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">equations-and-formulas:</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">= formula  |  </span></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">ADVANCE</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">EQ</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">SYMBOL</span></p>
  
  <p class="Grammar Normal DocDefaults "><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'Liberation Sans';">index-and-tables:</span><span class="DefaultParagraphFont " style="font-weight: bold;"><br /></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">INDEX</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">RD</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">TA</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">TC</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">TOA</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-weight: bold;text-decoration: underline;;font-family: 'Liberation Sans';">TOC</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">|  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">XE</span></p>
  
  <p class="Grammar Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">links-and-references:</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">AUTOTEXT</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">AUTOTEXTLIST</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">BIBLIOGRAPHY</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">CITATION</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">HYPERLINK</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  INCLUDEPICTURE  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">INCLUDETEXT</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">|  </span></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">LINK</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">NOTEREF</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">PAGEREF</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">QUOTE</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">REF</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">STYLEREF</span></p>
  
  <p class="Grammar Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">mail-merge:</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">ADDRESSBLOCK</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">ASK</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">COMPARE</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">DATABASE</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">FILLIN</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">GREETINGLINE</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">IF</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">|  </span></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">MERGEFIELD</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">MERGEREC</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">MERGESEQ</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">NEXT</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">NEXTIF</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">SET</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">SKIPIF</span></p>
  
  <p class="Grammar Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">numbering:</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">AUTONUM</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">AUTONUMLGL</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">AUTONUMOUT</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">BARCODE</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">LISTNUM</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">PAGE</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">REVNUM</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">|  </span></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">SECTION</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">SECTIONPAGES</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">SEQ</span></p>
  
  <p class="Grammar Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">user-information:</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">USERADDRESS</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">USERINITIALS</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  |  </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">USERNAME</span></p>
  
  <p class="Grammar Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">form-field:</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /></span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">FORMCHECKBOX</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;"> | </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">FORMDROPDOWN</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;"> | </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">FORMTEXT</span></p>
  
  <p class="Heading2 Normal DocDefaults "><a name="_Toc403733685" /><a name="_Toc41997755" /><span style="font-family: 'Liberation Serif';">TOC Content Control</span></p>
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';">Since the introduction of content controls in Word 2007, Word (References &gt; Table of Contents) inserts the TOC field in a content control:</span></p>
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style=""><img height="171" id="rId62" src="Docx4j_GettingStarted.docx_files/dde633cb-3e98-45a2-8fb6-d1201b97d80cimage1.png" width="468" /></span></p>
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">When inserting a TOC, both approaches documented here </span><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';">insert it in a content control.</span></p>
  
  <p class="Normal DocDefaults " style="border-left-style: solid;border-left-width: 1px;border-left-color: #E36C0A;border-right-style: solid;border-right-width: 1px;border-right-color: #E36C0A;"><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">When updating a TOC, the pure Java approach </span><span class="DefaultParagraphFont " style=""><span class="" style="font-family: 'Liberation Sans';">assumes the TOC is located in such a content control.   It won</span><span class="" style="">’</span><span class="" style="font-family: 'Liberation Sans';">t find the TOC field unless it is.</span></span></p>
  
  <p class="Heading2 Normal DocDefaults "><a name="_Toc403733686" /><a name="_Toc41997756" /><span style="font-family: 'Liberation Serif';">TOC Field Syntax</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">The TOC field instruction has the following components:</span></p>
  
  <p class="Grammar Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">TOC </span><br /><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;" /><span class="" style="font-family: 'Liberation Sans';">field-argument</span><br /><span class="" style="font-family: 'Liberation Sans';">switches</span><br /><span class="" style="font-family: 'Liberation Sans';">field-argument   switches</span><br /><span class="" style="font-family: 'Liberation Sans';">switches   field-argument</span></p>
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">The TOC field supports </span><span class="" style="font-family: 'Liberation Sans';">a variety of field-specific-switches.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">For example:</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">TOC \o "3-3" \h \z \t  "Heading 1,1,Heading 2,2,Appendix 1,1,Appendix 2,2" </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Of the switches in the Open XML specification, this TOC helper recognises:</span></p>
  
  <table id="docx4j_tbl_6" style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;position: relative; margin-left: 13mm;table-layout: fixed;vertical-align: top;border-collapse: collapse;width: 78%;"><colgroup><col style="width: 15.18%;" /><col style="width: 84.82%;" /></colgroup><tbody><tr><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'Liberation Sans';">\h</span></p></td><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';">Makes the table of contents entries hyperlinks.</span></p></td></tr><tr><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'Liberation Sans';">\n</span><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;"> field-argument</span></p></td><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';">Without field-argument, omits page numbers from the table of contents. Page numbers are omitted from all levels unless a range of entry levels is specified by text in this switch's field-argument. A range is specified as for \l.</span></p></td></tr><tr><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'Liberation Sans';">\o</span><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;"> field-argument</span></p></td><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';">Uses paragraphs formatted with all or the specified range of built-in heading styles. Headings in a style range are specified by text in this switch's field-argument using the notation specified as for \l, where each integer corresponds to the style with a style ID of HeadingX (e.g. 1 corresponds to Heading1). If no heading range is specified, all heading levels used in the document are listed.</span></p></td></tr><tr><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'Liberation Sans';">\t</span><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;"> field-argument</span></p></td><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';">Uses paragraphs formatted with styles other than the built-in heading styles. text in this switch's field-argument specifies those styles as a set of comma-separated doublets, with each doublet being a comma-separated set of style name and table of content level. \t can be combined with \o.</span></p></td></tr><tr><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'Liberation Sans';">\u</span></p></td><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';">Uses the applied paragraph outline level.</span></p></td></tr></tbody></table>
  
  <p class="Normal DocDefaults "> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">The following switches may also be supported in a future version:</span></p>
  
  <table id="docx4j_tbl_7" style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;position: relative; margin-left: 13mm;table-layout: fixed;vertical-align: top;border-collapse: collapse;width: 78%;"><colgroup><col style="width: 15.18%;" /><col style="width: 84.82%;" /></colgroup><tbody><tr><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';">\b field-argument</span></p></td><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';">Includes entries only from the portion of the document marked by the bookmark named by text in this switch's field-argument.</span></p></td></tr><tr><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';">\p field-argument</span></p></td><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';">text in this switch's field-argument specifies a sequence of characters that separate an entry and its page number. The default is a tab with leader dots.</span></p></td></tr><tr><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';">\w</span></p></td><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';">Preserves tab entries within table entries.</span></p></td></tr><tr><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';">\x</span></p></td><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-family: 'Liberation Sans';">Preserves newline characters within table entries.</span></p></td></tr></tbody></table>
  
  <p class="Normal DocDefaults "> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">There are no plans to support the remaining switches:</span></p>
  
  <table id="docx4j_tbl_8" style="border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;position: relative; margin-left: 13mm;table-layout: fixed;vertical-align: top;border-collapse: collapse;width: 78%;"><colgroup><col style="width: 15.18%;" /><col style="width: 84.82%;" /></colgroup><tbody><tr><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">\a field-argument</span></p></td><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">Includes captioned items, but omits caption labels and numbers. The identifier designated by text in this switch's field-argument corresponds to the caption label.</span></p>
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">Use \c to build a table of captions with labels and numbers.</span></p></td></tr><tr><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">\c field-argument</span></p></td><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">Includes figures, tables, charts, and other items that are numbered by a SEQ field. The sequence identifier designated by text in this switch's field-argument, which corresponds to the caption label, shall match the identifier in the corresponding SEQ field.</span></p></td></tr><tr><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">\d field-argument</span></p></td><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">When used with \s, the text in this switch's field-argument defines the separator between sequence and page numbers. The default separator is a hyphen (-).</span></p></td></tr><tr><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">\f field-argument</span></p></td><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">Includes only those TC fields whose identifier exactly matches the text in this switch's field-argument (which is typically a letter).</span></p></td></tr><tr><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">\l field-argument</span></p></td><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">Includes TC fields that assign entries to one of the levels specified by text in this switch's field-argument as a range having the form startLevel-endLevel, where startLevel and endLevel are integers, and startLevel has a value equal-to or less-than endLevel. TC fields that assign entries to lower levels are skipped.</span></p></td></tr><tr><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">\s field-argument</span></p></td><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">For entries numbered with a SEQ field, adds a prefix to the page number. The </span><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">prefix depends on the type of entry. text in this switch's field-argument shall match the identifier in the SEQ field.</span></p></td></tr><tr><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">\z</span></p></td><td style="background-color: #FFFFFF;border-bottom-style: solid;border-bottom-width: 1px;border-bottom-color: #000000;border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-top-style: solid;border-top-width: 1px;border-top-color: #000000;padding-bottom: 0.76mm;padding-left: 2.03mm;padding-right: 2.03mm;padding-top: 0.76mm;">
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">Hides tab leader and page numbers in Web layout view.</span></p></td></tr></tbody></table>
  
  <p class="Normal DocDefaults "> </p>
  
  <p class="Heading2 Normal DocDefaults "><a name="_Toc403733687" /><a name="_Toc41997757" /><span style="font-family: 'Liberation Serif';">Inserting/generating a TOC</span><span style="font-family: 'Liberation Serif';white-space:pre-wrap;"> – "pure Java" considerations</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">You should ensure styles TOC1, TOC2, TOC3 etc are defined in your styles definition part, since these are used to style TOC entries.  ToC Helper will fallback to hard coded defaults for these styles, if they are not defined.  The hard coded defaults come from:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">InputStream is = ResourceUtils.</span></span><span class="DefaultParagraphFont " style="color: #000000;font-style: italic;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">getResourceViaProperty</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">( </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><br />            </span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">"org.docx4j.toc.TocStyles.xml"</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">,</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">            </span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">"org/docx4j/toc/TocStyles.xml"</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">);</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">You can specify a different resource of your own in docx4j.properties:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"># Defaults to </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">com/plutext/docx/toc/TocStyles.xml</span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"># It provides default </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">toc</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> style definitions,</span></span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"># for use if none are defined in the </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">docx</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> itself.</span></span></p>
  
  <p class="Normal DocDefaults " style="position: relative; margin-left: 0.5in;margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.toc.TocStyles.xml=org/docx4j/toc/TocStyles.xml</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults "> </p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997758" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Text extraction</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">A quick way to extract the text from a docx, is to use </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">TextUtils</span><span class="" style="">‘  </span></span></p>
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">public static void </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">extractText(Object o, Writer w)</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">which marshals the object it is passed via a SAX ContentHandler, in order to output the text to the Writer.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997759" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Text substitution</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Text substitution is easy enough, provided the string you are searching for is represented in a </span><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">org.docx4j.wml.Text </span><span class="" style="font-family: 'Liberation Sans';">object in the form you expect.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">However, that won't necessarily be the case.  The string could be broken across text runs for any of the following reasons:</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">part of the word is formatted differently (eg in bold)</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">spelling/grammar</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">editing order (rsid)</span></li></ul>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">This is one reason that using data bound content controls is often a better approach (see next section).</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Subject to that, you can do text substitution in a variety of ways, for example:</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">traversing the main document part, and looking at the </span><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">org.docx4j.wml.Text </span><span style="font-family: 'Liberation Sans';">objects</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">marshal to a string, search/replace in that, then unmarshall again </span></li></ul>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">docx4j</span><span class="" style="">‘</span><span class="" style="font-family: 'Liberation Sans';">s XmlUtils also contains:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">     </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">/**</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">     </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">* Give a string of wml containing ${key1}, ${key2}, return a suitable</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">     </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">* object.*/</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">public static </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">Object unmarshallFromTemplate(String wmlTemplateString, </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">        </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">java.util.HashMap&lt;String, String&gt; mappings) </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;"><br /></span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">See the UnmarshallFromTemplate example, which operates on a string containing:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="font-size: 12.0pt;">   </span><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;w:p&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;w:r&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;w:t&gt;</span></span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">My favourite colour is </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #000000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">${colour}</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">.</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">w:t&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;</span></span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">w:r&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;</span></span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">w:p&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">&lt;w:p </span></span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;w:p&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;w:r&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;w:t&gt;</span></span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">My favourite ice cream is </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #000000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">${icecream}</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">.</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">w:t&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;</span></span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">w:r&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">&lt;</span></span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">/</span><span class="DefaultParagraphFont " style="color: #800000;font-size: 10.0pt;;font-family: 'DejaVu Sans Mono Bold';">w:p&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997760" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Text substitution via data bound content controls</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">If you have an XML file containing your own data, WordML has a mechansim for associating entries in that XML with content controls in the document.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Then, when you open the document in Word 2007, Word automatically populates the content controls with the relevant XML data, which could even be an image (or with docx4j, arbitrary XHTML)</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">.  (This approach supersedes Word's legacy mail merge fields.  Simple VBA for migrating a document is available at </span><a href="http://blogs.msdn.com/b/microsoft_office_word/archive/2007/03/28/migrating-mail-merge-fields-to-content-controls.aspx"><span class="Hyperlink DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">http://blogs.msdn.com/b/microsoft_office_word/archive/2007/03/28/migrating-mail-merge-fields-to-content-controls.aspx</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> )</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">This works using XPath.  A data-bound content control looks something like:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">      </span><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">&lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:sdt</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">        &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:sdtPr</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">          &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:dataBinding</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:xpath</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">=</span><span class="DefaultParagraphFont " style="font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">/root[1]/customer[1]</span><span class="DefaultParagraphFont " style="font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:storeItemID</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">=</span><span class="DefaultParagraphFont " style="font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">{428C88D8-C0E3-44F0-B5D7-F65D8B9F7EC9}</span><span class="DefaultParagraphFont " style="font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> /&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">        &lt;/</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:sdtPr</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">        &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:sdtContent</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">          &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:r</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">            &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:rPr</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">              &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:rStyle</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #FF0000;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:val</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">=</span><span class="DefaultParagraphFont " style="font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">PlaceholderText</span><span class="DefaultParagraphFont " style="font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">"</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> /&gt;</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">            &lt;/</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:rPr</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">            &lt;</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:t</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span><span class="DefaultParagraphFont " style="font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">Click here to enter text.</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">&lt;/</span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:t</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">          &lt;/</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:r</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">        &lt;/</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:sdtContent</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">      &lt;/</span></span><span class="DefaultParagraphFont " style="color: #A31515;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">w:sdt</span><span class="DefaultParagraphFont " style="color: #0000FF;font-size: 7.5pt;;font-family: 'DejaVu Sans Mono Bold';">&gt;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">You XML file is stored as a part in the docx, typically with a path which is something like customXml/item1.xml.   Note: despite the word "customXml" in the path, this functionality is not affected by the 2009 i4i patent saga.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">If you have a Word document which contains data-bound content controls and your data, docx4j can fetch the data, and place it in the relevant content controls.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">This is useful if you don't want to leave it to Word to do that (for example, you are creating PDFs with docx4j).</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Your XML is represented using 2 parts:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">CustomXmlDataStoragePart customXmlDataStoragePart </span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">= wordMLPackage.getCustomXmlDataStorageParts().get(itemId);</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">CustomXmlDataStorage customXmlDataStorage </span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">         <span class="" style="font-family: 'DejaVu Sans Mono Bold';">= customXmlDataStoragePart.getData();</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">To apply the bindings:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">      <span class="" style="font-family: 'DejaVu Sans Mono Bold';">customXmlDataStoragePart.</span></span><span class="DefaultParagraphFont " style="color: #000000;font-style: italic;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">applyBindings</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">(wordMLPackage.getMainDocumentPart());</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">See further the CustomXmlBinding sample. </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">If you want to create the same document 5 times, each populated with different data, obviously you'd need to insert new XML data first.</span></p>
  
  <p class="Heading2 Normal DocDefaults "><a name="_Toc41997761" /><span style="font-family: 'Liberation Serif';">Binding extensions for repeats and conditionals</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">A content control is </span><span class="DefaultParagraphFont " style="font-style: italic;;font-family: 'Liberation Sans';">conditional</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> if it (and its contents) are included/excluded from the document based on whether some condition is true or false.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">A content control is a </span><span class="DefaultParagraphFont " style="font-style: italic;;font-family: 'Liberation Sans';">repeat</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> if it designates that its contents are to be included more than once.  For example, a row of a table for each invoice/order item, or person.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">docx4j contains a mechanism for processing conditional content controls and repeats.  See </span><a href="http://www.opendope.org/opendope_conventions_v2.3.html"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">http://www.opendope.org/opendope_conventions_v2.3.html</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> for an explanation.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">See also the docx4j sample ContentControlBindingExtensions.</span></p>
  
  <p class="Heading2 Normal DocDefaults "><a name="_Toc41997762" /><span style="font-family: 'Liberation Serif';">Binding escaped XHTML (XML + CSS)</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">docx4j can also take encoded XHTML and convert this to docx content.</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> See further OpenDoPE_XHTML.docx in the docx4j docs directory.</span></p>
  
  <p class="Heading2 Normal DocDefaults "><a name="_Toc41997763" /><span style="font-family: 'Liberation Serif';">Binding other rich content</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">docx4j can take docx content (stored in an XML element as escaped Flat OPC XML) and convert this to docx content. </span></p>
  
  <p class="Heading2 Normal DocDefaults "><a name="_Toc41997764" /><span style="font-family: 'Liberation Serif';">Authoring</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">To set up the bindings, you can use one of the Word Add-In from </span><a href="http://www.opendope.org/implementations.html"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">http://www.opendope.org/implementations.html</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">  Please note that you will need to install .NET Framework 4.0 ("full" - the "client profile" is not enough).</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997765" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Mailmerge</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">docx4j has quite good support for processing fields of type MERGEFIELD (ie the equivalent of doing a mailmerge operation from within Microsoft Word).</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997766" /><span style="font-family: 'Liberation Serif';">SmartArt</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">docx4j supports reading docx and pptx files which contain SmartArt.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">From docx4j 2.7.0, you can also generate SmartArt.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">To do this, you need:</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">the layout definition for the SmartArt, either in the docx already, or from a glox file </span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">an XML file specifying the list of text items you want to render graphically</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">an XSLT which can convert a transformed version of that XML file into a SmartArt data file.</span></li></ul>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Docx4j can be used to insert the SmartArt parts into a docx; Word or Powerpoint will then render it when the document is opened.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">The code can be found in:</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">org.opendope.SmartArt.dataHierarchy</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">org.docx4j.openpackaging.parts.DrawingML, and</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">src/glox4j/java</span></li></ul>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997767" /><span style="font-family: 'Liberation Serif';">JAXB stuff</span></p>
  
  <p class="Heading2 Normal DocDefaults "><a name="_Toc41997768" /><span style="font-family: 'Liberation Serif';">Cloning</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">To clone a JAXB object, use one of the following methods in XmlUtils:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">/** Clone this JAXB object, using default JAXBContext. */ </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">public static </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">&lt;T&gt; T deepCopy(T value) </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">/** Clone this JAXB object */</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">public static </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">&lt;T&gt; T deepCopy(T value, JAXBContext jc) </span></p>
  
  <p class="Heading2 Normal DocDefaults "><a name="_Ref273527051" /><a name="_Toc41997769" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">javax.xml.bind.JAXBElement</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">One annoying thing about JAXB, is that an object </span><span class="" style="">– </span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">say a table </span><span class="" style="">– </span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">could be represented as </span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.wml.Tbl</span><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">(as you would expect).  Or it might be wrapped in a </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">javax.xml.bind.JAXBElement</span><span class="" style="font-family: 'Liberation Sans';">, in which case to get the real table, you have to do something like:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">     </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">if </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">( ((JAXBElement)o).getDeclaredType().getName().equals(</span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">"org.docx4j.wml.Tbl"</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">) ) </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">          </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.wml.Tbl tbl = (org.docx4j.wml.Tbl)((JAXBElement)o).getValue();</span></p>
  
  <p class="Normal DocDefaults "> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">XmlUtils.</span><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'Liberation Sans';">unwrap</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> can do this for you.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Be careful, though.  If you are intend to copy an unwrapped object into your document (rather than just read it), you'll probably want the object to remain wrapped (JAXB usually wraps them for a reason; without the wrapper, you might find you need an @XmlRootElement annotation in order to be able to marshall ie save your document).</span></p>
  
  <p class="Heading2 Normal DocDefaults "><a name="_Toc41997770" /><span style="font-family: 'Liberation Serif';">@XmlRootElement</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Most commonly used objects have an </span><span class="DefaultParagraphFont " style="font-weight: bold;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">@XmlRootElement </span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">annotation, so they can be marshalled and unmarshalled.  </span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">In some cases, you might find this annotation is missing.  </span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">If you can't add the annotation to the jaxb source code, an alternative is to </span><span class="DefaultParagraphFont " style="text-decoration: underline;;font-family: 'Liberation Sans';">marshall</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> it using code which is explicit about the resulting QName.  For example, XmlUtils contains:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">/** Marshal to a W3C document, for object</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">   </span><span class="DefaultParagraphFont " style="color: #3F5FBF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">*  missing an @XmlRootElement annotation.  */</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">public static </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.w3c.dom.Document marshaltoW3CDomDocument(Object o, JAXBContext jc,</span><span class="DefaultParagraphFont " style="font-size: 9.0pt;"><br /></span><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">      </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">String uri, String local, Class declaredType) </span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">You could use this like so:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">CTFootnotes footnotes = </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;"><br /></span><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">        </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">wmlPackage.getMainDocumentPart().getFootnotesPart().getJaxbElement().getValue();</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">CTFtnEdn ftn = footnotes.getFootnote().get(1);</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">// No @XmlRootElement on CTFtnEdn, so .. </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">Document d = XmlUtils.marshaltoW3CDomDocument( ftn,</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #FFFFFF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">        </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">Context.jc, Namespaces.NS_WORD12, </span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">"footnote"</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">,  CTFtnEdn.</span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">class </span><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">);</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="apple-style-span DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';white-space:pre-wrap;">Where the problematic object is something you're adding which isn't at the top of the tree, you should add it wrapped in a JAXBElement.  For example, suppose you wanted to add </span><span class="DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';">FldChar fldchar.  You'd create it in the ordinary way:</span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 9.0pt;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">    </span><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;">FldChar fldchar = factory.createFldChar();</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="apple-style-span DefaultParagraphFont " style="color: #000000;;font-family: 'Liberation Sans';">but then what you'd actually add to r.getRunContent() is:</span><span class="DefaultParagraphFont " style="color: #000000;">   </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'Liberation Mono';">new</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> JAXBElement( </span></span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'Liberation Mono';">new</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'Liberation Mono';white-space:pre-wrap;"> QName(Namespaces.</span></span><span class="DefaultParagraphFont " style="color: #0000C0;font-style: italic;font-size: 8.0pt;;font-family: 'Liberation Mono';">NS_WORD12</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'Liberation Mono';white-space:pre-wrap;">, </span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'Liberation Mono';">"fldChar"</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'Liberation Mono';">), FldChar.</span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'Liberation Mono';">class</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'Liberation Mono';">, fldchar);</span><span class="apple-style-span DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'Liberation Mono';white-space:pre-wrap;"> </span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';">An easier way to do this is to find the appropriate method in the object factory (ie the method for creating it wrapped as a JAXBElement).  Use that method signature.  In this example:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="color: #646464;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">@XmlElementDecl</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">(namespace = </span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">"http://schemas.openxmlformats.org/wordprocessingml/2006/main"</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">, name = </span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">"fldChar"</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">, scope = R.</span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">class</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">)</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">public</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> JAXBElement&lt;FldChar&gt; createRFldChar(FldChar value) {</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">        </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">return</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">new</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> JAXBElement&lt;FldChar&gt;(</span></span><span class="DefaultParagraphFont " style="color: #0000C0;font-style: italic;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">_RFldChar_QNAME</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">, FldChar.</span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">class</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">, R.</span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">class</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">, value);</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">    }</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-top: 0.07in;margin-bottom: 0.07in;line-height: 100%;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">The easiest way is to use the </span><a href="http://webapp.docx4java.org/OnlineDemo/PartsList.html"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">PartsList </span><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">online </span><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">webapp</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> to generate the relevant code.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997771" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Merging Documents and Presentations</span></p>
  
  <p class="NormalWeb Normal DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';">As</span><span class="apple-converted-space DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';"> </span><a href="http://blogs.msdn.com/b/ericwhite/archive/2008/11/03/inserting-deleting-moving-paragraphs-in-open-xml-wordprocessing-documents.aspx"><span class="Hyperlink DefaultParagraphFont " style="color: #AD582A;font-size: 11.0pt;"><span class="" style="font-family: 'Liberation Sans';">Eric White</span><span class="" style="">’</span><span class="" style="font-family: 'Liberation Sans';">s blog explained</span></span></a><span class="apple-converted-space DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';" /><span class="DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';">, combining multiple documents can be complicated:</span></p>
  
  <p class="NormalWeb Normal DocDefaults " style="position: relative; margin-left: 0.5in;"><span class="DefaultParagraphFont " style="color: #777777;font-size: 11.0pt;;font-family: 'Liberation Sans';">This programming task is complicated by the need to keep other parts of the document in sync with the data stored in paragraphs. For example, a paragraph can contain a reference to a comment in the comments part, and if there is a problem with this reference, the document is invalid. You must take care when moving / inserting / deleting paragraphs to maintain ‘</span><span class="Emphasis DefaultParagraphFont " style="font-weight: bold;color: #777777;font-size: 11.0pt;;font-family: 'Liberation Sans';">referential integrity</span><span class="DefaultParagraphFont " style="color: #777777;font-size: 11.0pt;;font-family: 'Liberation Sans';">’ within the document.</span></p>
  
  <p class="NormalWeb Normal DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';">Plutext’s Enterprise edition of docx4j includes “MergeDocx” code  which makes merging documents as easy as invoking the method:</span></p>
  
  <p class="Normal DocDefaults "><span class="HTMLCode DefaultParagraphFont " style="font-size: 8.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">public</span></span><span class="DefaultParagraphFont " style="font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">  </span></span><span class="HTMLCode DefaultParagraphFont " style="font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';">WordprocessingMLPackage merge(List&lt;WordprocessingMLPackage&gt; wmlPkgs)</span></span></p>
  
  <p class="NormalWeb Normal DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';">In other words, you pass a list of docx, and get a single new docx back.</span></p>
  
  <p class="NormalWeb Normal DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">To try it, visit </span><a href="http://webapp.docx4java.org/"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">http://webapp.docx4java.org/</span></a><span class="DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;" /></p>
  
  <p class="NormalWeb Normal DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">The commercial edition of docx4j includes </span><span class="DefaultParagraphFont " style="font-size: 11.0pt;;font-family: 'Liberation Sans';">MergePptx, which you can use to concatenate presentations.</span></p>
  
  <p class="NormalWeb Normal DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;">The MergeDocx extension can also be used to process a </span><span class="DefaultParagraphFont " style="font-weight: bold;color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';">docx</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';white-space:pre-wrap;"> which is embedded as an</span><span class="apple-converted-space DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';"> </span><span class="Strong DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';">altChunk</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';">.  (Without the extension, you have to rely on Word to convert the altChunk to normal content, which means if your docx contains w:altChunk, you have to round trip it through Word, before docx4j can create a PDF or HTML out of it.)</span></p>
  
  <p class="NormalWeb Normal DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';">To process the w:altChunk elements in a docx, you invoke:</span></p>
  
  <p class="Normal DocDefaults "><span class="HTMLCode DefaultParagraphFont " style="font-size: 8.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">public</span></span><span class="DefaultParagraphFont " style="font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="HTMLCode DefaultParagraphFont " style="font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">WordprocessingMLPackage process(WordprocessingMLPackage srcPackage)</span></p>
  
  <p class="NormalWeb Normal DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 11.0pt;;font-family: 'Liberation Sans';">You pass in a docx containg altChunks, and get a  new docx back which doesn’t.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997772" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Other Support Options</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">If the free community support available in the docx4j forum does not meet your needs, or you simply want to outsource some coding, you are welcome to purchase programming, consulting </span><span class="" style="font-family: 'Liberation Sans';">or</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> priority support from </span><a href="http://www.plutext.com/m/index.php/services"><span class="Hyperlink DefaultParagraphFont " style="font-size: 10.0pt;;font-family: 'Liberation Sans';">Plutext</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;" /></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">By purchasing services from Plutext, you support the continued development of docx4j.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997773" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Colophon</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">This document was written in Microsoft </span><span class="" style="font-family: 'Liberation Sans';">Word, using:</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">XML pretty printed using </span><a href="http://www.softlion.com/webTools/XmlPrettyPrint/default.aspx"><span class="DefaultParagraphFont " style="color: #0000FF;text-decoration: underline;;font-family: 'Liberation Sans';">http://www.softlion.com/webTools/XmlPrettyPrint/default.aspx</span></a><span style="font-family: 'Liberation Sans';white-space:pre-wrap;"> </span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">or Package Explorer</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">Java source code formatted using </span><a href="http://www.java2html.de"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">http://www.java2html.de</span></a><span style="font-family: 'Liberation Sans';white-space:pre-wrap;"> </span><span style="font-family: 'Liberation Sans';white-space:pre-wrap;">(or cut/pasted from Eclipse)</span></li></ul>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">The HTML version was </span><span class="" style="font-family: 'Liberation Sans';">generated using docx4j.</span></p>
  
  <p class="Heading1 Normal DocDefaults "><a name="_Toc41997774" /><span class="DefaultParagraphFont " style="font-family: 'Liberation Serif';">Contacting Plutext</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Unless you have paid for support, general </span><span class="" style="">“</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">How do I</span><span class="" style="">” </span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">type questions should be posted directly to the </span><a href="http://www.docx4java.org/forums/"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">docx4j forum</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> or StackOverflow.  Plutext may post to the forum any questions it receives by email which should have been directed to the forum.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Plutext can be contacted at either </span><a href="mailto:jason@plutext.org"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">jason@plutext.org</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">, or </span><a href="mailto:jharrop@plutext.com"><span class="Hyperlink DefaultParagraphFont " style="font-family: 'Liberation Sans';">jharrop@plutext.com</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;" /></p>
  
  <p class="Normal DocDefaults " style="page-break-before: always;"> </p>
  
  <p class="Normal DocDefaults "> </p>
  
  <p class="Normal DocDefaults " style="text-align: center;"><span class="DefaultParagraphFont " style="font-weight: bold;text-decoration: underline;;font-family: 'Liberation Sans';white-space:pre-wrap;">Appendix </span><span class="DefaultParagraphFont " style="font-weight: bold;text-decoration: underline;;font-family: 'Liberation Sans';">1</span><span class="DefaultParagraphFont " style="font-weight: bold;text-decoration: underline;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> </span><span class="" style="">– </span></span><span class="DefaultParagraphFont " style="font-weight: bold;text-decoration: underline;;font-family: 'Liberation Sans';">Font Mapping</span></p>
  
  <p class="Normal DocDefaults " style="border-left-style: solid;border-left-width: 1px;border-left-color: #000000;border-right-style: solid;border-right-width: 1px;border-right-color: #000000;border-color: #FFFF00; border-style:solid; border-width:1px;background-color: #FFFF00;"><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">This section is not relevant if you are using Plutext</span><span class="" style="">’</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">s PDF Converter for PDF output.  The PDF Converter uses the most appropriate fonts installed and available to it. </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">docx4j can only use fonts which are available to it.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">These fonts come from 2 sources:</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">those installed on the computer</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">those embedded in the document</span></li></ul>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">Note that Word silently performs </span><span class="DefaultParagraphFont " style="font-weight: bold;font-style: italic;;font-family: 'Liberation Sans';">font substitution</span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">.  When you open an existing document in Word, and select text in a particular font, the actual font you see on the screen won't be the font reported in the ribbon if it is not installed on your computer or embedded in the document.  To see whether Word 2007 is substituting a font, go into Word Options &gt; Advanced &gt; Show Document Content and press the "Font Substitution" button.  </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">Word's font substitution information is not available to docx4j.  As a developer, you 3 options:</span></p><ul>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">ensure the font is installed or embedded</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">tell docx4j which font to use instead, or</span></li>
  
  <li class="ListParagraph Normal DocDefaults " style="display: list-item;"><span style="font-family: 'Liberation Sans';">allow docx4j to fallback to a default font</span></li></ul>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">To embed a font in a document, open it in Word on a computer which has the font installed (check no substitution is occuring), and go to Word Options &gt; Save &gt; Embed Fonts in File.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">If you want to tell docx4j to use a different font, you need to add a font mapping.  The FontMapper interface is used to do this.</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">On a Windows computer, font names for installed fonts are mapped 1:1 to the corresponding physical fonts via the IdentityPlusMapper. </span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">A font mapper contains Map&lt;String, PhysicalFont&gt;; to add a font mapping, as per the example in the ConvertOutPDF sample:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">// Set up font </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">mapper</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">Mapper fontMapper = </span></span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">new</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> IdentityPlusMapper();</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">wordMLPackage.setFontMapper(fontMapper);</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">         </span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">// Example of mapping missing font Algerian to installed font Comic </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">Sans</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> MS</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">PhysicalFont font = PhysicalFonts.</span></span><span class="DefaultParagraphFont " style="color: #000000;font-style: italic;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">getPhysicalFonts</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">().get(</span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">"Comic Sans MS"</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">);</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">fontMapper.getFontMappings().put(</span></span><span class="DefaultParagraphFont " style="color: #2A00FF;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">"Algerian"</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">, font);</span></p>
  
  <p class="Normal DocDefaults "> </p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;">You'll see the font names if you configure log4j debug level logging for </span><span class="DefaultParagraphFont " style="font-weight: bold;font-size: 9.0pt;;font-family: 'DejaVu Sans Mono Bold';">org.docx4j.fonts.PhysicalFonts</span></p>
  
  <p class="Normal DocDefaults "><span class="" style="font-family: 'Liberation Sans';">To conserve resources, you can restrict to a subset of fonts installed on your system:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">// Font </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">regex</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> (optional)</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">// Set </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">regex</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> if you want to restrict to some defined subset of fonts</span></span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">// Here we have to do this before calling createContent,</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">// since that discovers fonts</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">String regex = </span></span><span class="DefaultParagraphFont " style="font-weight: bold;color: #7F0055;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">null</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">;</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">// Windows:</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">// String</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 6.0pt;">   </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">// </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">regex</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;;font-family: 'DejaVu Sans Mono Bold';">=".*(</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">calibri</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;;font-family: 'DejaVu Sans Mono Bold';">|</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">cour</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;;font-family: 'DejaVu Sans Mono Bold';">|</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">arial</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;;font-family: 'DejaVu Sans Mono Bold';">|times|comic|</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">georgia</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;;font-family: 'DejaVu Sans Mono Bold';">|impact|LSANS|</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">pala</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;;font-family: 'DejaVu Sans Mono Bold';">|</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">tahoma</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;;font-family: 'DejaVu Sans Mono Bold';">|</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">trebuc</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;;font-family: 'DejaVu Sans Mono Bold';">|</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">verdana</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;;font-family: 'DejaVu Sans Mono Bold';">|symbol|</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">webdings</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;;font-family: 'DejaVu Sans Mono Bold';">|</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">wingding</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 6.0pt;;font-family: 'DejaVu Sans Mono Bold';">).*";</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">// </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">Mac</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">// String</span></p>
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">// </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">regex</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">=".*(Courier New|</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">Arial</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">|Times New Roman|Comic </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">Sans</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">|</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">Georgia</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">|Impact|</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">Lucida</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;"><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> Console|</span></span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">Lucida</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">Sans</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">Unicode</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">|</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">Palatino</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">Linotype</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">|</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">Tahoma</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">|</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">Trebuchet</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">|</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">Verdana</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">|Symbol|</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">Webdings</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">|</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">Wingdings</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">|MS </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">Sans</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">Serif</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;">|MS </span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;text-decoration: underline;;font-family: 'DejaVu Sans Mono Bold';">Serif</span><span class="DefaultParagraphFont " style="color: #3F7F5F;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">).*";</span></p>
  
  <p class="Normal DocDefaults "><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;">   <span class="" style="font-family: 'DejaVu Sans Mono Bold';">PhysicalFonts.</span></span><span class="DefaultParagraphFont " style="color: #000000;font-style: italic;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">setRegex</span><span class="DefaultParagraphFont " style="color: #000000;font-size: 8.0pt;;font-family: 'DejaVu Sans Mono Bold';">(regex);</span><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span></p>
  
  <p class="Normal DocDefaults "> </p></div>
  
  <div class="footnotes">
  
  <p class="Normal DocDefaults " style="margin-bottom: 0in;line-height: 100%;"> </p>
  
  <p class="FootnoteText Normal DocDefaults "><span class="FootnoteReference DefaultParagraphFont " style="vertical-align: top; font-size: xx-small"><a name="fn1"><a href="#fs1">1</a></a></span><span class="" style="font-family: 'DejaVu Sans Mono Bold';white-space:pre-wrap;"> </span><span class="" style="font-family: 'Liberation Sans';">IBM has their own proprietary JAXB implementation.  By default, WebSphere uses com.ibm.xml.xlxp2.jaxb, which has the concept of fallback/ MarshallerProxy.  The actual implementation it uses is in com.ibm.jaxb.tools.jar.</span></p>
  
  <p class="FootnoteText Normal DocDefaults "><span class="FootnoteReference DefaultParagraphFont " style="vertical-align: top; font-size: xx-small"><a name="fn2"><a href="#fs2">2</a></a></span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> If you get the error 'Access restriction: The type</span><span class="apple-converted-space DefaultParagraphFont " style="font-family: 'Liberation Sans';"> </span><span class="underline DefaultParagraphFont " style="font-family: 'Liberation Sans';white-space:pre-wrap;">is not accessible due to restriction on required library rt.jar' (perhaps using some combination of Eclipse 3.4 and/or JDK 6 update 10?), you need to go into the Build Path for the project, Libraries tab, select the JRE System Library, and add an access rule, "Accessible, **". </span></p>
  
  <p class="FootnoteText Normal DocDefaults "><span class="FootnoteReference DefaultParagraphFont " style="vertical-align: top; font-size: xx-small"><a name="fn3"><a href="#fs3">3</a></a></span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> </span><a href="#null"><span class="Hyperlink DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">http://blogs.msdn.com/b/dmahugh/archive/2009/01/16/ecma-376-implementation-notes-for-office-2007-sp2.aspx</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;" /></p>
  
  <p class="FootnoteText Normal DocDefaults "><span class="FootnoteReference DefaultParagraphFont " style="vertical-align: top; font-size: xx-small"><a name="fn4"><a href="#fs4">4</a></a></span><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;"> </span><a href="#null"><span class="Hyperlink DefaultParagraphFont " style="font-size: 9.0pt;;font-family: 'Liberation Sans';">http://blogs.msdn.com/b/dmahugh/archive/2010/04/06/office-s-support-for-iso-iec-29500-strict.aspx</span></a><span class="" style="font-family: 'Liberation Sans';white-space:pre-wrap;" /></p></div>
  
  
  
  
  
  <!-- userBodyTail goes here -->
  
  </body></html>